A component which provides Apache Velocity templating engine integration.
A typical use:
VelocityContext context = new VelocityContext(); VelocityComponent velocityComponent = (VelocityComponent) lookup( VelocityComponent.ROLE ); Template template = velocityComponent.getEngine().getTemplate( "path to your template" ); StringWriter writer = new StringWriter(); template.merge( context, writer );
Plexus Velocity Component comes with a default configuration: it is
expected to be customized to match local specific need. This is done by hand writing a
META-INF/plexus/components.xml
Plexus descriptor.
A typical component configuration:
<component> <role>org.codehaus.plexus.velocity.VelocityComponent</role> <implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation> <configuration> <properties> <property> <name>resource.loaders</name> <value>classpath</value> </property> <property> <name>resource.loader.classpath.class</name> <value>org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</value> </property> </properties> </configuration> </component>
See Velocity Configuration reference documentation for details on available configurations.