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 SummaryNested ClassesModifier and TypeClassDescriptionstatic enumArchive layout types.Nested classes/interfaces inherited from class org.springframework.boot.maven.AbstractDependencyFilterMojoAbstractDependencyFilterMojo.ExcludeTestScopeArtifactFilter, AbstractDependencyFilterMojo.RuntimeArtifactFilter
- 
Field SummaryFieldsModifier 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.MojoROLE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.AbstractDependencyFilterMojofilterDependencies, getDependencyURLs, setExcludeGroupIds, setExcludes, setIncludes, toURLMethods inherited from class org.apache.maven.plugin.AbstractMojogetLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojoexecute
- 
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- 
AbstractPackagerMojopublic AbstractPackagerMojo()
 
- 
- 
Method Details- 
getLayoutReturn 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
 
- 
getLayoutFactoryprotected 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
 
- 
getConfiguredPackagerprotected <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
 
- 
getLibrariesprotected 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
 
- 
getSourceArtifactReturn 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
 
-