public abstract class AbstractPackagerMojo extends AbstractDependencyFilterMojo
Packager
.Modifier and Type | Class and Description |
---|---|
static class |
AbstractPackagerMojo.LayoutType
Archive layout types.
|
Modifier and Type | Field and Description |
---|---|
boolean |
includeSystemScope
Include system scoped dependencies.
|
protected org.apache.maven.project.MavenProject |
project
The Maven project.
|
protected org.apache.maven.project.MavenProjectHelper |
projectHelper
Maven project helper utils.
|
protected org.apache.maven.execution.MavenSession |
session
The Maven session.
|
Constructor and Description |
---|
AbstractPackagerMojo() |
Modifier and Type | Method and Description |
---|---|
protected <P extends org.springframework.boot.loader.tools.Packager> |
getConfiguredPackager(java.util.function.Supplier<P> supplier)
Return a
Packager configured for this MOJO. |
protected AbstractPackagerMojo.LayoutType |
getLayout()
Return the type of archive that should be packaged by this MOJO.
|
protected org.springframework.boot.loader.tools.LayoutFactory |
getLayoutFactory()
Return the layout factory that will be used to determine the
AbstractPackagerMojo.LayoutType if
no explicit layout is set. |
protected org.springframework.boot.loader.tools.Libraries |
getLibraries(java.util.Collection<org.apache.maven.model.Dependency> unpacks)
Return
Libraries that the packager can use. |
protected org.apache.maven.artifact.Artifact |
getSourceArtifact(java.lang.String classifier)
Return the source
Artifact to repackage. |
protected java.io.File |
getTargetFile(java.lang.String finalName,
java.lang.String classifier,
java.io.File targetDirectory) |
filterDependencies, getFilters, setExcludeGroupIds, setExcludes, setIncludes
getLog, getPluginContext, setLog, setPluginContext
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession session
@Component protected org.apache.maven.project.MavenProjectHelper projectHelper
@Parameter(defaultValue="false") public boolean includeSystemScope
protected AbstractPackagerMojo.LayoutType getLayout()
null
, indicating a layout type will be chosen based on the original
archive typeprotected org.springframework.boot.loader.tools.LayoutFactory getLayoutFactory()
AbstractPackagerMojo.LayoutType
if
no explicit layout is set.null
, indicating a default layout factory will be chosenprotected <P extends org.springframework.boot.loader.tools.Packager> P getConfiguredPackager(java.util.function.Supplier<P> supplier)
Packager
configured for this MOJO.P
- the packager typesupplier
- a packager supplierprotected final org.springframework.boot.loader.tools.Libraries getLibraries(java.util.Collection<org.apache.maven.model.Dependency> unpacks) throws org.apache.maven.plugin.MojoExecutionException
Libraries
that the packager can use.unpacks
- any libraries that require unpackorg.apache.maven.plugin.MojoExecutionException
- on execution errorprotected org.apache.maven.artifact.Artifact getSourceArtifact(java.lang.String classifier)
Artifact
to repackage. If a classifier is specified and
an artifact with that classifier exists, it is used. Otherwise, the main artifact
is used.classifier
- the artifact classifierprotected java.io.File getTargetFile(java.lang.String finalName, java.lang.String classifier, java.io.File targetDirectory)