@Mojo(name="velocity",
defaultPhase=GENERATE_TEST_RESOURCES,
threadSafe=true,
requiresProject=true,
requiresDependencyResolution=COMPILE_PLUS_RUNTIME)
public class VelocityMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
encoding
Encodage
|
private java.io.File |
outputDirectory
Repertoire de sortie
|
private org.apache.maven.project.MavenProject |
project
Projet Maven en cours
|
private org.apache.maven.model.FileSet |
templateFiles
Ensemble de fichiers template
|
private java.util.Properties |
templateValues
Valeurs de substitution
|
| Constructor and Description |
|---|
VelocityMojo() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addPropertiesToContext(org.apache.velocity.VelocityContext context,
java.util.Properties properties)
Methode permettant de rajouter des proprietes au contexte
|
void |
execute() |
private java.util.List<?> |
expandFileSet()
Methode permettant d'obtenir la liste des fichiers en entree
|
private java.lang.String |
listToCsvString(java.util.List<?> patterns)
Methode permettant de charger transformer la liste de patter de fichiers en chaine CSV
|
private void |
translateFile(org.apache.velocity.app.VelocityEngine engine,
java.lang.String basedir,
java.lang.String templateFile,
org.apache.velocity.VelocityContext context)
Methode permettant de transformer un template en resolvant ses variables
|
@Component private org.apache.maven.project.MavenProject project
@Parameter(required=false,
defaultValue="")
private java.lang.String encoding
@Parameter(required=true) private java.io.File outputDirectory
@Parameter(required=true) private org.apache.maven.model.FileSet templateFiles
@Parameter(required=true) private java.util.Properties templateValues
public void execute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprivate void addPropertiesToContext(org.apache.velocity.VelocityContext context,
java.util.Properties properties)
context - Contexteproperties - Proprietes a rajouterprivate java.util.List<?> expandFileSet()
throws java.io.IOException
java.io.IOException - Exception potentielleprivate java.lang.String listToCsvString(java.util.List<?> patterns)
patterns - Liste de patternprivate void translateFile(org.apache.velocity.app.VelocityEngine engine,
java.lang.String basedir,
java.lang.String templateFile,
org.apache.velocity.VelocityContext context)
throws java.lang.Exception
basedir - Repertoire de basetemplateFile - Fichier templatecontext - Contexte Velocityjava.lang.Exception - Exception potentielleCopyright © 2018 Leadware. All Rights Reserved.