Package org.codehaus.modello.maven
Class AbstractModelloGeneratorMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.modello.maven.AbstractModelloGeneratorMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractModelloSourceGeneratorMojo
,ModelloJsonSchemaGeneratorMojo
,ModelloVelocityMojo
,ModelloXdocMojo
,ModelloXsdMojo
public abstract class AbstractModelloGeneratorMojo
extends org.apache.maven.plugin.AbstractMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Base directory of the project, from where the Modello models are loaded.private org.sonatype.plexus.build.incremental.BuildContext
private ModelloCore
Note: This is passed by Maven and must not be configured by the user.private String[]
List of relative paths to mdo files containing the models.Additional historical versions to generate, each being packaged with the version regardless of thepackageWithVersion
setting.private boolean
True if the generated package names should include the version.private org.apache.maven.project.MavenProject
The Maven project instance for the executing project.private String
The version of the model we will be working on.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Properties
Creates a Properties objects.protected void
customizeParameters
(Properties parameters) Override this method to customize the values in the properties set.private void
doExecute
(String modelStr, String outputDirectory, Properties parameters) Performs execute on a single specified model.void
execute()
protected abstract String
String[]
abstract File
boolean
org.apache.maven.project.MavenProject
protected boolean
protected boolean
void
setBasedir
(String basedir) void
setBuildContext
(org.sonatype.plexus.build.incremental.BuildContext context) void
setModelloCore
(ModelloCore modelloCore) void
void
setPackagedVersions
(List<String> packagedVersions) void
setPackageWithVersion
(boolean packageWithVersion) void
setProject
(org.apache.maven.project.MavenProject project) void
setVersion
(String version) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
basedir
Base directory of the project, from where the Modello models are loaded. -
models
List of relative paths to mdo files containing the models. -
version
The version of the model we will be working on. -
packageWithVersion
@Parameter(property="packageWithVersion", defaultValue="false", required=true) private boolean packageWithVersionTrue if the generated package names should include the version. -
modelloCore
Note: This is passed by Maven and must not be configured by the user.
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) private org.apache.maven.project.MavenProject projectThe Maven project instance for the executing project. -
packagedVersions
Additional historical versions to generate, each being packaged with the version regardless of thepackageWithVersion
setting. -
buildContext
@Component private org.sonatype.plexus.build.incremental.BuildContext buildContext- Since:
- 1.0.1
-
-
Constructor Details
-
AbstractModelloGeneratorMojo
public AbstractModelloGeneratorMojo()
-
-
Method Details
-
getGeneratorType
-
getOutputDirectory
-
producesCompilableResult
protected boolean producesCompilableResult() -
producesResources
protected boolean producesResources() -
createParameters
Creates a Properties objects.
The abstract mojo will override the output directory, the version and the package with version flag.- Returns:
- the parameters
-
customizeParameters
Override this method to customize the values in the properties set.This method will be called after the parameters have been populated with the parameters in the abstract mojo.
- Parameters:
parameters
- the parameters to customize
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
doExecute
private void doExecute(String modelStr, String outputDirectory, Properties parameters) throws org.apache.maven.plugin.MojoExecutionException Performs execute on a single specified model.- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getBasedir
-
setBasedir
-
getVersion
-
setVersion
-
getPackageWithVersion
public boolean getPackageWithVersion() -
setPackageWithVersion
public void setPackageWithVersion(boolean packageWithVersion) -
getModelloCore
-
setModelloCore
-
setBuildContext
public void setBuildContext(org.sonatype.plexus.build.incremental.BuildContext context) -
getProject
public org.apache.maven.project.MavenProject getProject() -
setProject
public void setProject(org.apache.maven.project.MavenProject project) -
setPackagedVersions
-
getModels
- Returns:
- Returns the paths to the models.
-
setModels
- Parameters:
models
- Sets the paths to the models.
-