Class AbstractModelloGeneratorMojo

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String basedir
      Base directory of the project.
      private org.sonatype.plexus.build.incremental.BuildContext buildContext  
      private ModelloCore modelloCore
      Note: This is passed by Maven and must not be configured by the user.
      private java.lang.String[] models
      List of relative paths to mdo files containing the models.
      private java.util.List<java.lang.String> packagedVersions
      Additional historical versions to generate, each being packaged with the version regardless of the packageWithVersion setting.
      private boolean packageWithVersion
      True if the generated package names should include the version.
      private org.apache.maven.project.MavenProject project
      The Maven project instance for the executing project.
      private java.lang.String version
      The version of the model we will be working on.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Field Detail

      • basedir

        @Parameter(defaultValue="${basedir}",
                   readonly=true,
                   required=true)
        private java.lang.String basedir
        Base directory of the project.
      • models

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

        @Parameter(property="version",
                   required=true)
        private java.lang.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 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 java.util.List<java.lang.String> packagedVersions
        Additional historical versions to generate, each being packaged with the version regardless of the packageWithVersion setting.
      • buildContext

        @Component
        private org.sonatype.plexus.build.incremental.BuildContext buildContext
        Since:
        1.0.1
    • Constructor Detail

      • AbstractModelloGeneratorMojo

        public AbstractModelloGeneratorMojo()
    • Method Detail

      • getGeneratorType

        protected abstract java.lang.String getGeneratorType()
      • getOutputDirectory

        public abstract java.io.File getOutputDirectory()
      • producesCompilableResult

        protected boolean producesCompilableResult()
      • producesResources

        protected boolean producesResources()
      • createParameters

        protected java.util.Properties 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​(java.util.Properties 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​(java.lang.String modelStr,
                               java.lang.String outputDirectory,
                               java.util.Properties parameters)
                        throws org.apache.maven.plugin.MojoExecutionException
        Performs execute on a single specified model.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getBasedir

        public java.lang.String getBasedir()
      • setBasedir

        public void setBasedir​(java.lang.String basedir)
      • getVersion

        public java.lang.String getVersion()
      • setVersion

        public void setVersion​(java.lang.String version)
      • getPackageWithVersion

        public boolean getPackageWithVersion()
      • setPackageWithVersion

        public void setPackageWithVersion​(boolean packageWithVersion)
      • setModelloCore

        public void setModelloCore​(ModelloCore modelloCore)
      • 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

        public void setPackagedVersions​(java.util.List<java.lang.String> packagedVersions)
      • getModels

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

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