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 Details

    • basedir

      @Parameter(defaultValue="${basedir}", required=true) private String basedir
      Base directory of the project, from where the Modello models are loaded.
    • models

      @Parameter(required=true) private String[] models
      List of relative paths to mdo files containing the models.
    • version

      @Parameter(property="version", required=true) private String version
      The version of the model we will be working on.
    • packageWithVersion

      @Parameter(property="packageWithVersion", defaultValue="false", required=true) private boolean packageWithVersion
      True if the generated package names should include the version.
    • modelloCore

      @Component private org.codehaus.modello.core.ModelloCore 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 project
      The Maven project instance for the executing project.
    • packagedVersions

      @Parameter private List<String> packagedVersions
      Additional historical versions to generate, each being packaged with the version regardless of the packageWithVersion setting.
    • licenseText

      @Parameter private String licenseText
      The contents of license header text, verbatim.
      Since:
      2.3.1
    • licenseFile

      @Parameter private File licenseFile
      The file that contains license header text. If both configured, the licenseText prevails.
      Since:
      2.3.1
    • pluralExceptions

      @Parameter private Map<String,String> pluralExceptions
      Additional exceptions to the singularization rules, changing plural noun to singular.

      As a key we provide plural noun and as value we provide singular noun, example:

           <kisses>kiss</kisses>
       
      Since:
      2.5.0
    • buildContext

      @Component private org.codehaus.plexus.build.BuildContext buildContext
      Since:
      1.0.1
  • Constructor Details

    • AbstractModelloGeneratorMojo

      public AbstractModelloGeneratorMojo()
  • Method Details

    • getGeneratorType

      protected abstract String getGeneratorType()
    • getOutputDirectory

      public abstract File getOutputDirectory()
    • producesCompilableResult

      protected boolean producesCompilableResult()
    • producesResources

      protected boolean producesResources()
    • createParameters

      protected Map<String,Object> 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

      protected void customizeParameters(Map<String,Object> parameters)
      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, Map<String,Object> parameters) throws org.apache.maven.plugin.MojoExecutionException
      Performs execute on a single specified model.
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getBasedir

      public String getBasedir()
    • setBasedir

      public void setBasedir(String basedir)
    • getVersion

      public String getVersion()
    • setVersion

      public void setVersion(String version)
    • getPackageWithVersion

      public boolean getPackageWithVersion()
    • setPackageWithVersion

      public void setPackageWithVersion(boolean packageWithVersion)
    • getModelloCore

      public org.codehaus.modello.core.ModelloCore getModelloCore()
    • setModelloCore

      public void setModelloCore(org.codehaus.modello.core.ModelloCore modelloCore)
    • setBuildContext

      public void setBuildContext(org.codehaus.plexus.build.BuildContext context)
    • getProject

      public org.apache.maven.project.MavenProject getProject()
    • setProject

      public void setProject(org.apache.maven.project.MavenProject project)
    • setPackagedVersions

      public void setPackagedVersions(List<String> packagedVersions)
    • getModels

      public String[] getModels()
      Returns:
      Returns the paths to the models.
    • setModels

      public void setModels(String[] models)
      Parameters:
      models - Sets the paths to the models.