Package org.springframework.boot.maven
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 org.springframework.boot.maven.AbstractPackagerMojo
AbstractPackagerMojo.LayoutType
Nested classes/interfaces inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojo
AbstractDependencyFilterMojo.ExcludeTestScopeArtifactFilter, AbstractDependencyFilterMojo.RuntimeArtifactFilter
-
Field Summary
Fields inherited from class org.springframework.boot.maven.AbstractPackagerMojo
includeSystemScope, project, projectHelper, session
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
protected AbstractPackagerMojo.LayoutType
Return the type of archive that should be packaged by this MOJO.protected org.springframework.boot.loader.tools.LayoutFactory
Return the layout factory that will be used to determine theAbstractPackagerMojo.LayoutType
if no explicit layout is set.protected org.springframework.boot.loader.tools.LoaderImplementation
Return the loader implementation that should be used.Methods inherited from class org.springframework.boot.maven.AbstractPackagerMojo
getConfiguredPackager, getLibraries, getSourceArtifact, getTargetFile
Methods inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojo
filterDependencies, getDependencyURLs, setExcludeGroupIds, setExcludes, setIncludes, toURL
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
RepackageMojo
public RepackageMojo()
-
-
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
-
getLoaderImplementation
protected org.springframework.boot.loader.tools.LoaderImplementation getLoaderImplementation()Description copied from class:AbstractPackagerMojo
Return the loader implementation that should be used.- Overrides:
getLoaderImplementation
in classAbstractPackagerMojo
- Returns:
- the loader implementation or
null
-
getLayoutFactory
protected 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
-