net.rumati.maven.plugins.velocity.VelocityMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of velocity-maven-plugin Show documentation
Show all versions of velocity-maven-plugin Show documentation
A Maven plugin that uses Apache Velocity to process templates, populating variables from the Maven POM.
package net.rumati.maven.plugins.velocity;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.nio.charset.Charset;
import java.util.Map;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
/**
* Processes a Velocity template
*
* @goal velocity
* @phase process-resources
*/
public class VelocityMojo
extends AbstractMojo
{
/**
* Template file
* @parameter
* @required
*/
private File template;
/**
* Output file
* @parameter
* @required
*/
private File outputFile;
/**
* Properties to populate in the template
* @parameter
* @required
*/
private Map