Package com.mt_ag.jar.module
Class UpdateModules
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.mt_ag.jar.module.UpdateModules
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
JlinkMojo,PackageMojo
public abstract class UpdateModules extends org.apache.maven.plugin.AbstractMojoInterface to update the jar as modules. Generates the module-info.java for the jar.
-
-
Field Summary
Fields Modifier and Type Field Description static intEXTENSION_LENGTHThe length of an extension.
-
Constructor Summary
Constructors Modifier Constructor Description UpdateModules()The standard constructor.protectedUpdateModules(boolean pOpenmodule, boolean pCreatemissing)The constructor for tests.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CallResultcallInDir(Path dir, String... param)Calls a command in the dir.protected PathcreateModules(org.apache.maven.project.MavenProject project)Creates a copy of the jar of the dependencies to test and update the modules.protected PathzipDir(Path dir, Path targetPath, String subName)Creates a zip of the dir.
-
-
-
Field Detail
-
EXTENSION_LENGTH
public static final int EXTENSION_LENGTH
The length of an extension.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UpdateModules
public UpdateModules()
The standard constructor.
-
UpdateModules
protected UpdateModules(boolean pOpenmodule, boolean pCreatemissing)The constructor for tests.- Parameters:
pOpenmodule- use as openmodule.pCreatemissing- create the missing classes in the missing module.
-
-
Method Detail
-
callInDir
protected CallResult callInDir(Path dir, String... param) throws org.apache.maven.plugin.MojoExecutionException
Calls a command in the dir.- Parameters:
dir- the working dir of the call.param- the list of parameters.- Returns:
- lines returned.
- Throws:
org.apache.maven.plugin.MojoExecutionException- thrown, when an error occurs.
-
zipDir
protected Path zipDir(Path dir, Path targetPath, String subName) throws org.apache.maven.plugin.MojoExecutionException
Creates a zip of the dir.- Parameters:
dir- the dir to zip.targetPath- the targetPath.subName- the sub name.- Returns:
- the used zipPath.
- Throws:
org.apache.maven.plugin.MojoExecutionException- thrown if an error occurs.
-
createModules
protected Path createModules(org.apache.maven.project.MavenProject project) throws org.apache.maven.plugin.MojoExecutionException
Creates a copy of the jar of the dependencies to test and update the modules.- Parameters:
project- the maven project.- Returns:
- return the path of the modules dir.
- Throws:
org.apache.maven.plugin.MojoExecutionException- is thrown if an IOException is thrown.
-
-