Class AbstractModuleMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    ModuleFileMojo, ModuleInjectMojo

    public abstract class AbstractModuleMojo
    extends org.apache.maven.plugin.AbstractMojo
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String exports
      A comma-separated list of exported packages.
      protected int javaVersion
      The Java version in which the module-info.class file should be compiled.
      private java.lang.String mainClass
      The main class of this module (optional).
      protected boolean multirelease
      Determines if the module-info.class is added as a class file of a multi-release jar file.
      private java.lang.String name
      The name of the module.
      private java.lang.String opens
      A comma-separated list of opened packages.
      private java.lang.String packages
      A comma-separated list of packages of the module.
      private java.util.List<Provide> provides
      A list of provided services.
      private java.util.List<QualifiedPackage> qualifiedExports
      A list of qualified exports.
      private java.util.List<QualifiedPackage> qualifiedOpens
      A list of qualified opens.
      private java.lang.String requires
      A comma-separated list of required modules.
      private boolean skip
      If set to true, the plugin is not executed.
      private java.lang.String staticRequires
      A comma-separated list of statically required modules.
      private java.lang.String uses
      A comma-separated list of used services.
      private java.lang.String version
      The version of the module (optional).
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void doExecute()  
      void execute()  
      protected java.lang.String filename()  
      protected byte[] makeModuleInfo()  
      • 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

      • javaVersion

        @Parameter(name="java-version",
                   defaultValue="9")
        protected int javaVersion
        The Java version in which the module-info.class file should be compiled.
      • name

        @Parameter(required=true)
        private java.lang.String name
        The name of the module.
      • version

        @Parameter
        private java.lang.String version
        The version of the module (optional).
      • multirelease

        @Parameter(required=true,
                   defaultValue="false")
        protected boolean multirelease
        Determines if the module-info.class is added as a class file of a multi-release jar file. To function correctly, using this option requires a manifest declaring Multi-Release: true.
      • packages

        @Parameter
        private java.lang.String packages
        A comma-separated list of packages of the module. This attribute is optional but offers an optimization that is normally applied by the Java JAR tool. By naming all packages, the runtime does not need to scan the jar file upon loading it but can use the list of explicitly named packages.
      • requires

        @Parameter
        private java.lang.String requires
        A comma-separated list of required modules.
      • staticRequires

        @Parameter(name="static-requires")
        private java.lang.String staticRequires
        A comma-separated list of statically required modules.
      • exports

        @Parameter
        private java.lang.String exports
        A comma-separated list of exported packages.
      • opens

        @Parameter
        private java.lang.String opens
        A comma-separated list of opened packages.
      • qualifiedExports

        @Parameter(name="qualified-exports")
        private java.util.List<QualifiedPackage> qualifiedExports
        A list of qualified exports.
      • qualifiedOpens

        @Parameter(name="qualified-opens")
        private java.util.List<QualifiedPackage> qualifiedOpens
        A list of qualified opens.
      • mainClass

        @Parameter(name="main-class")
        private java.lang.String mainClass
        The main class of this module (optional).
      • uses

        @Parameter
        private java.lang.String uses
        A comma-separated list of used services.
      • provides

        @Parameter
        private java.util.List<Provide> provides
        A list of provided services.
      • skip

        @Parameter(required=true,
                   defaultValue="false")
        private boolean skip
        If set to true, the plugin is not executed.
    • Constructor Detail

      • AbstractModuleMojo

        public AbstractModuleMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • doExecute

        protected abstract void doExecute()
                                   throws org.apache.maven.plugin.MojoExecutionException,
                                          org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • filename

        protected java.lang.String filename()
      • makeModuleInfo

        protected byte[] makeModuleInfo()
                                 throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException