Package com.mt_ag.jar.module
Class CleanJarMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.mt_ag.jar.module.CleanJarMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="jar", defaultPhase=PACKAGE) public class CleanJarMojo extends org.apache.maven.plugin.AbstractMojoPlugin class for the goal jar. In this goal the jar is cleaned form unused folder entries and the size is set correct. Saves 4 bytes per entry.
-
-
Constructor Summary
Constructors Modifier Constructor Description CleanJarMojo()The default constructor.protectedCleanJarMojo(org.apache.maven.plugin.logging.Log pLog, boolean pRepack)The constructor for testing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Pathexec(Path jarPath)The main execute method to update the jar and clean it.voidexecute()The implementation.
-
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionThe implementation. Sets the main class if it is a module and the main class is not set but part of the manifest.- Throws:
org.apache.maven.plugin.MojoExecutionException- is thrown if an error occurs.
-
exec
protected Path exec(Path jarPath) throws org.apache.maven.plugin.MojoExecutionException
The main execute method to update the jar and clean it.- Parameters:
jarPath- the path to the artifact(jar).- Returns:
- the new artifact.
- Throws:
org.apache.maven.plugin.MojoExecutionException- is thrown if an IOException is thrown.
-
-