Class OptionListerMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="optionlister",
          threadSafe=false,
          defaultPhase=COMPILE,
          requiresDependencyResolution=COMPILE)
    public class OptionListerMojo
    extends AbstractAdamsMojo
    Outputs the classes or packages as props files.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • OptionListerMojo

        public OptionListerMojo()
    • Method Detail

      • shouldExecutionBeSkipped

        protected boolean shouldExecutionBeSkipped()
        Implement this method to check if this AbstractAdamsMojo should skip executing altogether.
        Specified by:
        shouldExecutionBeSkipped in class AbstractAdamsMojo
        Returns:
        true to indicate that this AbstractAdamsMojo should bail out of its execute method.
      • addResource

        protected void addResource​(org.apache.maven.model.Resource resource)
        Adds the supplied Resource to the project using the appropriate scope (i.e. resource or testResource) depending on the exact implementation of this AbstractAdamsMojo.
        Specified by:
        addResource in class AbstractAdamsMojo
        Parameters:
        resource - The resource to add.
      • isReGenerationRequired

        protected boolean isReGenerationRequired()

        Java generation is required if any of the file products is outdated/stale.

        Specified by:
        isReGenerationRequired in class AbstractAdamsMojo
        Returns:
        true to indicate that this AbstractAdamsMojo should be run since its generated files were either stale or not present, and false otherwise.
      • performExecution

        protected boolean performExecution()
                                    throws org.apache.maven.plugin.MojoExecutionException,
                                           org.apache.maven.plugin.MojoFailureException

        Implement this method to perform this Mojo's execution. This method will only be called if !shouldExecutionBeSkipped() && isReGenerationRequired().

        Specified by:
        performExecution in class AbstractAdamsMojo
        Returns:
        true if the timestamp of the stale file should be updated.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if an unexpected problem occurs. Throwing this exception causes a "BUILD ERROR" message to be displayed.
        org.apache.maven.plugin.MojoFailureException - if an expected problem (such as a compilation failure) occurs. Throwing this exception causes a "BUILD FAILURE" message to be displayed.
      • getOutputDirectory

        protected File getOutputDirectory()
        Retrieves the directory where the generated files should be written to.
        Specified by:
        getOutputDirectory in class AbstractAdamsMojo
        Returns:
        the directory where the generated files should be written to.