Class RepackageMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.springframework.boot.maven.AbstractDependencyFilterMojo
org.springframework.boot.maven.AbstractPackagerMojo
org.springframework.boot.maven.RepackageMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
@Mojo(name="repackage",
defaultPhase=PACKAGE,
requiresProject=true,
threadSafe=true,
requiresDependencyResolution=COMPILE_PLUS_RUNTIME,
requiresDependencyCollection=COMPILE_PLUS_RUNTIME)
public class RepackageMojo
extends AbstractPackagerMojo
Repackage existing JAR and WAR archives so that they can be executed from the command
line using java -jar. With
layout=NONE
can also be used simply
to package a JAR with nested dependencies (and no main class, so not executable).- Since:
- 1.0.0
- Author:
- Phillip Webb, Dave Syer, Stephane Nicoll, Björn Lindström, Scott Frederick
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractPackagerMojo
AbstractPackagerMojo.LayoutType
Nested classes/interfaces inherited from class AbstractDependencyFilterMojo
AbstractDependencyFilterMojo.ExcludeTestScopeArtifactFilter, AbstractDependencyFilterMojo.RuntimeArtifactFilter
-
Field Summary
Fields inherited from class AbstractPackagerMojo
includeOptional, includeSystemScope, includeTools, project, projectHelper, session
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
protected @Nullable AbstractPackagerMojo.LayoutType
Return the type of archive that should be packaged by this MOJO.protected @Nullable org.springframework.boot.loader.tools.LayoutFactory
Return the layout factory that will be used to determine theAbstractPackagerMojo.LayoutType
if no explicit layout is set.Methods inherited from class AbstractPackagerMojo
getConfiguredPackager, getLibraries, getSourceArtifact, getTargetFile
Methods inherited from class AbstractDependencyFilterMojo
filterDependencies, getDependencyURLs, setExcludeGroupIds, setExcludes, setIncludes, toURL
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
RepackageMojo
@Inject public RepackageMojo(org.apache.maven.project.MavenProjectHelper projectHelper)
-
-
Method Details
-
getLayout
Return the type of archive that should be packaged by this MOJO.- Overrides:
getLayout
in classAbstractPackagerMojo
- Returns:
- the value of the
layout
parameter, ornull
if the parameter is not provided
-
getLayoutFactory
protected @Nullable org.springframework.boot.loader.tools.LayoutFactory getLayoutFactory()Return the layout factory that will be used to determine theAbstractPackagerMojo.LayoutType
if no explicit layout is set.- Overrides:
getLayoutFactory
in classAbstractPackagerMojo
- Returns:
- the value of the
layoutFactory
parameter, ornull
if the parameter is not provided
-
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
-