Class ModuleInjectMojo

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

    @Mojo(name="inject-module",
          defaultPhase=PACKAGE)
    public class ModuleInjectMojo
    extends AbstractModuleMojo
    A Maven plugin for injecting a module-info.class into an existing jar file.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String classifier
      The classifier to add to any additional artifact of this build that contains the module-info.class file.
      private boolean createMultiReleaseFolderEntry
      Determines if a folder entry should be created for a module-info.class file that is placed in a multi-release jar if META-INF/versions/[java]/ does not exist.
      private java.lang.String directory  
      private java.lang.String finalName  
      private java.lang.String outputTimestamp
      Defines an output timestamp for JAR entries.
      private org.apache.maven.project.MavenProject project  
      private org.apache.maven.project.MavenProjectHelper projectHelper  
      private boolean replace
      true if the original artifact should be replaced with a jar file containing the module-info.class.
      private java.lang.String source
      Specifies the location of the jar file which should be enhanced with a module-info.class file.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doExecute()  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • project

        @Parameter(defaultValue="${project}",
                   readonly=true,
                   required=true)
        private org.apache.maven.project.MavenProject project
      • projectHelper

        @Component
        private org.apache.maven.project.MavenProjectHelper projectHelper
      • directory

        @Parameter(defaultValue="${project.build.directory}",
                   required=true,
                   readonly=true)
        private java.lang.String directory
      • finalName

        @Parameter(defaultValue="${project.build.finalName}",
                   required=true,
                   readonly=true)
        private java.lang.String finalName
      • source

        @Parameter
        private java.lang.String source
        Specifies the location of the jar file which should be enhanced with a module-info.class file.
      • classifier

        @Parameter(defaultValue="modularized")
        private java.lang.String classifier
        The classifier to add to any additional artifact of this build that contains the module-info.class file. If replace is set to true, this classifier is used for the name of the intermediate jar file. If it is empty, the standard classifier modularized is used.
      • replace

        @Parameter(defaultValue="true")
        private boolean replace
        true if the original artifact should be replaced with a jar file containing the module-info.class.
      • createMultiReleaseFolderEntry

        @Parameter(defaultValue="true")
        private boolean createMultiReleaseFolderEntry
        Determines if a folder entry should be created for a module-info.class file that is placed in a multi-release jar if META-INF/versions/[java]/ does not exist.
      • outputTimestamp

        @Parameter(defaultValue="${project.build.outputTimestamp}")
        private java.lang.String outputTimestamp
        Defines an output timestamp for JAR entries.
    • Constructor Detail

      • ModuleInjectMojo

        public ModuleInjectMojo()
    • Method Detail

      • doExecute

        protected void doExecute()
                          throws org.apache.maven.plugin.MojoExecutionException,
                                 org.apache.maven.plugin.MojoFailureException
        Specified by:
        doExecute in class AbstractModuleMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException