java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.basepom.mojo.repack.RepackMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="repack",
defaultPhase=PACKAGE,
requiresProject=true,
threadSafe=true,
requiresDependencyResolution=COMPILE_PLUS_RUNTIME,
requiresDependencyCollection=COMPILE_PLUS_RUNTIME)
public final class RepackMojo
extends org.apache.maven.plugin.AbstractMojo
Repack archives for execution using java -jar. Can also be used to repack a jar with nested dependencies by using
layout=NONE
.-
Field Summary
Modifier and TypeFieldDescriptionboolean
Attach the repacked archive to the build cycle.Set<org.basepom.mojo.repack.DependencyDefinition>
Collection of artifact definitions to exclude.Name of the generated archive.Set<org.basepom.mojo.repack.DependencyDefinition>
Collection of artifact definitions to include.boolean
Include optional dependenciesboolean
Include provided scoped dependencies.boolean
Include system scoped dependencies.org.basepom.mojo.repack.LayoutType
The type of archive (which corresponds to how the dependencies are laid out inside it).org.springframework.boot.loader.tools.LayoutFactory
The layout factory that will be used to create the executable archive if no explicit layout is set.The name of the main class.Set<org.basepom.mojo.repack.DependencyDefinition>
A list of optional libraries that should be included even if optional dependencies are not included by default.Directory containing the generated archive.Timestamp for reproducible output archive entries, either formatted as ISO 8601 (yyyy-MM-dd'T'HH:mm:ssXXX
) or anint
representing seconds since the epoch.org.apache.maven.project.MavenProject
org.apache.maven.project.MavenProjectHelper
boolean
Silence all non-output and non-error messages.Classifier to add to the repacked archive.boolean
Do a summary report.Set<org.basepom.mojo.repack.DependencyDefinition>
A list of the libraries that must be unpacked at runtime (do not work within the fat jar).org.apache.maven.execution.MavenSession
boolean
Skip the execution.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
void
setExcludedDependencies
(String... excludedDependencies) void
setIncludedDependencies
(String... includedDependencies) void
setOptionalDependencies
(String... optionalDependencies) void
setRuntimeUnpackedDependencies
(String... runtimeUnpackedDependencies) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) public org.apache.maven.project.MavenProject project -
session
@Parameter(defaultValue="${session}", readonly=true, required=true) public org.apache.maven.execution.MavenSession session -
projectHelper
@Component public org.apache.maven.project.MavenProjectHelper projectHelper -
mainClass
The name of the main class. If not specified the first compiled class found that contains amain
method will be used. -
includedDependencies
@Parameter(alias="includes") public Set<org.basepom.mojo.repack.DependencyDefinition> includedDependenciesCollection of artifact definitions to include. -
excludedDependencies
@Parameter(alias="excludedDependencies") public Set<org.basepom.mojo.repack.DependencyDefinition> excludedDependenciesCollection of artifact definitions to exclude. -
includeSystemScope
@Parameter(defaultValue="false", property="repack.include-system-scope") public boolean includeSystemScopeInclude system scoped dependencies. -
includeProvidedScope
@Parameter(defaultValue="false", property="repack.include-provided-scope") public boolean includeProvidedScopeInclude provided scoped dependencies. -
includeOptional
@Parameter(defaultValue="false", property="repack.include-optional") public boolean includeOptionalInclude optional dependencies -
outputDirectory
@Parameter(defaultValue="${project.build.directory}", property="repack.output-directory") public File outputDirectoryDirectory containing the generated archive. -
finalName
@Parameter(defaultValue="${project.build.finalName}", property="repack.final-name") public String finalNameName of the generated archive. -
skip
@Parameter(defaultValue="false", property="repack.skip") public boolean skipSkip the execution. -
quiet
@Parameter(defaultValue="false", property="repack.quiet") public boolean quietSilence all non-output and non-error messages. -
report
@Parameter(defaultValue="true", property="repack.report") public boolean reportDo a summary report. -
repackClassifier
Classifier to add to the repacked archive. Use the blank string to replace the main artifact. -
attachRepackedArtifact
@Parameter(defaultValue="true", property="repack.attach-artifact") public boolean attachRepackedArtifactAttach the repacked archive to the build cycle. -
runtimeUnpackedDependencies
A list of the libraries that must be unpacked at runtime (do not work within the fat jar). -
optionalDependencies
A list of optional libraries that should be included even if optional dependencies are not included by default. -
outputTimestamp
@Parameter(defaultValue="${project.build.outputTimestamp}", property="repack.output-timestamp") public String outputTimestampTimestamp for reproducible output archive entries, either formatted as ISO 8601 (yyyy-MM-dd'T'HH:mm:ssXXX
) or anint
representing seconds since the epoch. -
layout
@Parameter(defaultValue="JAR", property="repack.layout") public org.basepom.mojo.repack.LayoutType layoutThe type of archive (which corresponds to how the dependencies are laid out inside it). Possible values areJAR
,WAR
,ZIP
,DIR
,NONE
. Defaults toJAR
. -
layoutFactory
@Parameter public org.springframework.boot.loader.tools.LayoutFactory layoutFactoryThe layout factory that will be used to create the executable archive if no explicit layout is set. Alternative layouts implementations can be provided by 3rd parties.
-
-
Constructor Details
-
RepackMojo
public RepackMojo()
-
-
Method Details
-
setIncludedDependencies
-
setExcludedDependencies
-
setRuntimeUnpackedDependencies
-
setOptionalDependencies
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-