Package org.springframework.boot.maven
Class AbstractPackagerMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.springframework.boot.maven.AbstractDependencyFilterMojo
org.springframework.boot.maven.AbstractPackagerMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
BuildImageMojo,RepackageMojo
Abstract base class for classes that work with an
Packager.- Since:
- 2.3.0
- Author:
- Phillip Webb, Scott Frederick
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumArchive layout types.Nested classes/interfaces inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojo
AbstractDependencyFilterMojo.ExcludeTestScopeArtifactFilter, AbstractDependencyFilterMojo.RuntimeArtifactFilter -
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanInclude system scoped dependencies.protected org.apache.maven.project.MavenProjectThe Maven project.protected org.apache.maven.project.MavenProjectHelperMaven project helper utils.protected org.apache.maven.execution.MavenSessionThe Maven session.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <P extends org.springframework.boot.loader.tools.Packager>
PgetConfiguredPackager(Supplier<P> supplier) Return aPackagerconfigured for this MOJO.protected AbstractPackagerMojo.LayoutTypeReturn the type of archive that should be packaged by this MOJO.protected org.springframework.boot.loader.tools.LayoutFactoryReturn the layout factory that will be used to determine theAbstractPackagerMojo.LayoutTypeif no explicit layout is set.protected final org.springframework.boot.loader.tools.LibrariesgetLibraries(Collection<org.apache.maven.model.Dependency> unpacks) ReturnLibrariesthat the packager can use.protected org.apache.maven.artifact.ArtifactgetSourceArtifact(String classifier) Return the sourceArtifactto repackage.protected FilegetTargetFile(String finalName, String classifier, File targetDirectory) Methods inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojo
filterDependencies, getDependencyURLs, setExcludeGroupIds, setExcludes, setIncludes, toURLMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject projectThe Maven project.- Since:
- 1.0.0
-
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession sessionThe Maven session.- Since:
- 2.4.0
-
projectHelper
@Component protected org.apache.maven.project.MavenProjectHelper projectHelperMaven project helper utils.- Since:
- 1.0.0
-
includeSystemScope
@Parameter(defaultValue="false") public boolean includeSystemScopeInclude system scoped dependencies.- Since:
- 1.4.0
-
-
Constructor Details
-
AbstractPackagerMojo
public AbstractPackagerMojo()
-
-
Method Details
-
getLayout
Return the type of archive that should be packaged by this MOJO.- Returns:
null, indicating a layout type will be chosen based on the original archive type
-
getLayoutFactory
protected org.springframework.boot.loader.tools.LayoutFactory getLayoutFactory()Return the layout factory that will be used to determine theAbstractPackagerMojo.LayoutTypeif no explicit layout is set.- Returns:
null, indicating a default layout factory will be chosen
-
getConfiguredPackager
protected <P extends org.springframework.boot.loader.tools.Packager> P getConfiguredPackager(Supplier<P> supplier) Return aPackagerconfigured for this MOJO.- Type Parameters:
P- the packager type- Parameters:
supplier- a packager supplier- Returns:
- a configured packager
-
getLibraries
protected final org.springframework.boot.loader.tools.Libraries getLibraries(Collection<org.apache.maven.model.Dependency> unpacks) throws org.apache.maven.plugin.MojoExecutionException ReturnLibrariesthat the packager can use.- Parameters:
unpacks- any libraries that require unpack- Returns:
- the libraries to use
- Throws:
org.apache.maven.plugin.MojoExecutionException- on execution error
-
getSourceArtifact
Return the sourceArtifactto repackage. If a classifier is specified and an artifact with that classifier exists, it is used. Otherwise, the main artifact is used.- Parameters:
classifier- the artifact classifier- Returns:
- the source artifact to repackage
-
getTargetFile
-