Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

211 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plexus Velocity

Maven Central GitHub CI Reproducible Builds License

A ready-configured Apache Velocity engine as an injectable component, so a plugin can render a template without setting up Velocity itself.

Status

Maintained, quietly. It is a thin wrapper over Velocity; most changes here are Velocity upgrades.

Using it

<dependency>
  <groupId>org.codehaus.plexus</groupId>
  <artifactId>plexus-velocity</artifactId>
  <version>2.3.0</version>
</dependency>

Check the badge above for the current version.

@Inject
VelocityComponent velocityComponent;

VelocityContext context = new VelocityContext();
Template template = velocityComponent.getEngine().getTemplate( "path/to/template.vm" );
StringWriter writer = new StringWriter();
template.merge( context, writer );

The default configuration is meant to be customised: provide a VelocityComponentConfigurator implementation and it will be picked up. It is optional. See the Velocity configuration reference for what can be set.

Requirements

Java 8 or later.

Documentation

Contributing

See CONTRIBUTING.md. In short: mvn verify builds, and run mvn spotless:apply before pushing or CI will fail on formatting.

Please report security vulnerabilities privately — see SECURITY.md, not a public issue.

Releases

Used by

Contributors

Languages