Package org.codehaus.modello.maven
Class ModelloGenerateMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.modello.maven.AbstractModelloGeneratorMojo
-
- org.codehaus.modello.maven.AbstractModelloSourceGeneratorMojo
-
- org.codehaus.modello.maven.ModelloGenerateMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="generate", defaultPhase=GENERATE_SOURCES, threadSafe=true) public class ModelloGenerateMojo extends AbstractModelloSourceGeneratorMojo
A dynamic way to use generators and Modello plugins.
Example Usage:
<plugin> <groupId>org.codehaus.modello</groupId> <artifactId>modello-maven-plugin</artifactId> <version>1.3</version> <dependencies> <dependency> <groupId>org.codehaus.modello</groupId> <artifactId>modello-plugin-jpa</artifactId> <version>1.0.0-SNAPSHOT</version> </dependency> </dependencies> <configuration> <version>1.0.0</version> <packageWithVersion>false</packageWithVersion> <models> <model>src/main/mdo/project-model.xml</model> </models> </configuration> <executions> <execution> <id>java</id> <goals> <goal>generate</goal> </goals> <configuration> <generatorId>java</generatorId> </configuration> </execution> <execution> <id>jpa</id> <goals> <goal>generate</goal> </goals> <configuration> <generatorId>jpa-mapping</generatorId> </configuration> </execution> </executions> </plugin>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
generatorId
private java.util.Map<java.lang.String,ModelloGenerator>
generatorMap
-
Constructor Summary
Constructors Constructor Description ModelloGenerateMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
protected java.lang.String
getGeneratorType()
-
Methods inherited from class org.codehaus.modello.maven.AbstractModelloSourceGeneratorMojo
customizeParameters, getOutputDirectory, producesCompilableResult, setOutputDirectory
-
Methods inherited from class org.codehaus.modello.maven.AbstractModelloGeneratorMojo
createParameters, getBasedir, getModelloCore, getModels, getPackageWithVersion, getProject, getVersion, producesResources, setBasedir, setBuildContext, setModelloCore, setModels, setPackagedVersions, setPackageWithVersion, setProject, setVersion
-
-
-
-
Field Detail
-
generatorMap
@Component(role=ModelloGenerator.class) private java.util.Map<java.lang.String,ModelloGenerator> generatorMap
-
generatorId
@Parameter(property="modello.generator.id", defaultValue="java") private java.lang.String generatorId
-
-
Method Detail
-
getGeneratorType
protected java.lang.String getGeneratorType()
- Specified by:
getGeneratorType
in classAbstractModelloGeneratorMojo
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Overrides:
execute
in classAbstractModelloGeneratorMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-