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
Fields Modifier and Type Field Description private java.lang.StringexportsA comma-separated list of exported packages.protected intjavaVersionThe Java version in which themodule-info.classfile should be compiled.private java.lang.StringmainClassThe main class of this module (optional).protected booleanmultireleaseDetermines if themodule-info.classis added as a class file of a multi-release jar file.private java.lang.StringnameThe name of the module.private java.lang.StringopensA comma-separated list of opened packages.private java.lang.StringpackagesA comma-separated list of packages of the module.private java.util.List<Provide>providesA list of provided services.private java.util.List<QualifiedPackage>qualifiedExportsA list of qualified exports.private java.util.List<QualifiedPackage>qualifiedOpensA list of qualified opens.private java.lang.StringrequiresA comma-separated list of required modules.private booleanskipIf set totrue, the plugin is not executed.private java.lang.StringstaticRequiresA comma-separated list of statically required modules.private java.lang.StringusesA comma-separated list of used services.private java.lang.StringversionThe version of the module (optional).
-
Constructor Summary
Constructors Constructor Description AbstractModuleMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoExecute()voidexecute()protected java.lang.Stringfilename()protected byte[]makeModuleInfo()
-
-
-
Field Detail
-
javaVersion
@Parameter(name="java-version", defaultValue="9") protected int javaVersionThe Java version in which themodule-info.classfile 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 multireleaseDetermines if themodule-info.classis added as a class file of a multi-release jar file. To function correctly, using this option requires a manifest declaringMulti-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 skipIf set totrue, the plugin is not executed.
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.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.MojoExecutionExceptionorg.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
-
-