Package codes.rafael.modulemaker
Class AbstractModuleMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
codes.rafael.modulemaker.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
FieldsModifier and TypeFieldDescriptionprivate String
A comma-separated list of exported packages.protected int
The Java version in which themodule-info.class
file should be compiled.private String
The main class of this module (optional).protected boolean
Determines if themodule-info.class
is added as a class file of a multi-release jar file.private String
The name of the module.private String
A comma-separated list of opened packages.private String
A comma-separated list of packages of the module.A list of provided services.private List<QualifiedPackage>
A list of qualified exports.private List<QualifiedPackage>
A list of qualified opens.private String
A comma-separated list of required modules.private boolean
If set totrue
, the plugin is not executed.private String
A comma-separated list of statically required modules.private String
A comma-separated list of used services.private String
The version of the module (optional).Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
javaVersion
@Parameter(name="java-version", defaultValue="9") protected int javaVersionThe Java version in which themodule-info.class
file should be compiled. -
name
The name of the module. -
version
The version of the module (optional). -
multirelease
@Parameter(required=true, defaultValue="false") protected boolean multireleaseDetermines if themodule-info.class
is added as a class file of a multi-release jar file. To function correctly, using this option requires a manifest declaringMulti-Release: true
. -
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
A comma-separated list of required modules. -
staticRequires
A comma-separated list of statically required modules. -
exports
A comma-separated list of exported packages. -
opens
A comma-separated list of opened packages. -
qualifiedExports
A list of qualified exports. -
qualifiedOpens
A list of qualified opens. -
mainClass
The main class of this module (optional). -
uses
A comma-separated list of used services. -
provides
A list of provided services. -
skip
@Parameter(required=true, defaultValue="false") private boolean skipIf set totrue
, the plugin is not executed.
-
-
Constructor Details
-
AbstractModuleMojo
public AbstractModuleMojo()
-
-
Method Details
-
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
-
makeModuleInfo
protected byte[] makeModuleInfo() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-