modello:velocity
Full name:
org.codehaus.modello:modello-maven-plugin:2.1.0:velocity
Description:
Creates files from the model using Velocity templates.
This mojo can be given a list of templates and a list of parameters. Each template from the templates
property will be run with the following context:
version
: the version of the model to generatemodel
: the modello modelHelper
: aorg.codehaus.modello.plugin.velocity.Helper
object instance- any additional parameters specified using the
params
property
#MODELLO-VELOCITY#SAVE-OUTPUT-TO
VTL directive. This allows a single template to generate multiple files. For example, the following directive will redirect further output from the template to a file named org/apache/maven/api/model/Plugin.java
if the variable package
is set to org.apache.maven.api.model
and the variable className
is set to Plugin
.
#MODELLO-VELOCITY#SAVE-OUTPUT-TO ${package.replace('.','/')
/${className}.java}
Attributes:
- Requires a Maven project to be executed.
- The goal is thread-safe and supports parallel builds.
- Binds by default to the lifecycle phase:
generate-sources
.
Required Parameters
Name | Type | Since | Description |
---|---|---|---|
<models> |
String[] |
- |
List of relative paths to mdo files containing the models. |
<outputDirectory> |
File |
- |
The output directory of the generated files. Default value is: ${project.build.directory}/generated-sources/modello . |
<packageWithVersion> |
boolean |
- |
True if the generated package names should include the version. Default value is: false .User property is: packageWithVersion . |
<version> |
String |
- |
The version of the model we will be working on. User property is: version . |
Optional Parameters
Name | Type | Since | Description |
---|---|---|---|
<packagedVersions> |
List<String> |
- |
Additional historical versions to generate, each being packaged with the version regardless of the packageWithVersion setting. |
<params> |
List<String> |
- |
A list of parameters using the syntax key=value . Those parameters will be made accessible to the templates. |
<templates> |
List<File> |
- |
A list of template files to be run against the loaded modello model. Those are .vm files as described in the Velocity Users Guide. |
Parameter Details
<models>
List of relative paths to mdo files containing the models.
- Type:
java.lang.String[]
- Required:
Yes
<outputDirectory>
The output directory of the generated files.
- Type:
java.io.File
- Required:
Yes
- Default:
${project.build.directory}/generated-sources/modello
<packagedVersions>
Additional historical versions to generate, each being packaged with the version regardless of the
packageWithVersion
setting.- Type:
java.util.List<java.lang.String>
- Required:
No
<packageWithVersion>
True if the generated package names should include the version.
- Type:
boolean
- Required:
Yes
- User Property:
packageWithVersion
- Default:
false
<params>
A list of parameters using the syntax
key=value
. Those parameters will be made accessible to the templates.- Type:
java.util.List<java.lang.String>
- Required:
No
<templates>
A list of template files to be run against the loaded modello model. Those are
.vm
files as described in the Velocity Users Guide.- Type:
java.util.List<java.io.File>
- Required:
No
<version>
The version of the model we will be working on.
- Type:
java.lang.String
- Required:
Yes
- User Property:
version