Package org.basepom.inline.mojo
Class InlineMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.basepom.inline.mojo.InlineMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="inline",
defaultPhase=PACKAGE,
requiresProject=true,
threadSafe=true,
requiresDependencyResolution=COMPILE_PLUS_RUNTIME,
requiresDependencyCollection=COMPILE_PLUS_RUNTIME)
public final class InlineMojo
extends org.apache.maven.plugin.AbstractMojo
Inlines one or more dependencies of the project, relocated the classes and writes a new artifact.
-
Field Summary
Modifier and TypeFieldDescriptionboolean
Fail if any duplicate exists after processing the contents.boolean
Fail if an inline dependency is defined but the corresponding dependency is not actually found.boolean
Hide inlined classes from IDE autocompletion.boolean
If true, attach the inlined artifact, if false replace the original artifact.The name of the classifier used in case the inlined artifact is attached.org.apache.maven.project.ProjectBuilder
org.apache.maven.execution.MavenSession
The destination directory for the inlined artifact.The path to the output file for the inlined artifact.The path to the output file for the new POM file.The POM file to use.Defines the package prefix for all relocated classes.org.apache.maven.project.MavenProject
org.apache.maven.project.ProjectDependenciesResolver
org.apache.maven.project.MavenProjectHelper
boolean
Silence all non-output and non-error messages.List<org.apache.maven.project.MavenProject>
boolean
If true, replace the POM file with a new version that has all inlined dependencies removed.org.eclipse.aether.RepositorySystem
boolean
Skip the execution.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
boolean
isDependencyIncluded
(org.eclipse.aether.graph.Dependency dependency) void
setAdditionalProcessors
(List<String> processors) void
setExcludes
(List<ArtifactIdentifier> excludes) void
setIncludes
(List<ArtifactIdentifier> includes) void
setInlineDependencies
(List<InlineDependency> inlineDependencies) 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 -
mavenSession
@Parameter(defaultValue="${session}", readonly=true, required=true) public org.apache.maven.execution.MavenSession mavenSession -
reactorProjects
@Parameter(defaultValue="${reactorProjects}", readonly=true, required=true) public List<org.apache.maven.project.MavenProject> reactorProjects -
mavenProjectBuilder
@Component public org.apache.maven.project.ProjectBuilder mavenProjectBuilder -
projectDependenciesResolver
@Component public org.apache.maven.project.ProjectDependenciesResolver projectDependenciesResolver -
repositorySystem
@Component public org.eclipse.aether.RepositorySystem repositorySystem -
projectHelper
@Component public org.apache.maven.project.MavenProjectHelper projectHelper -
outputDirectory
The destination directory for the inlined artifact. -
pomFile
The POM file to use. -
hideClasses
@Parameter(defaultValue="true", property="inline.hide-classes") public boolean hideClassesHide inlined classes from IDE autocompletion. -
skip
@Parameter(defaultValue="false", property="inline.skip") public boolean skipSkip the execution. -
quiet
@Parameter(defaultValue="false", property="inline.quiet") public boolean quietSilence all non-output and non-error messages. -
prefix
Defines the package prefix for all relocated classes. This prefix must be a valid package name. All relocated classes are put under this prefix. -
failOnNoMatch
@Parameter(defaultValue="true", property="inline.failOnNoMatch") public boolean failOnNoMatchFail if an inline dependency is defined but the corresponding dependency is not actually found. -
failOnDuplicate
@Parameter(defaultValue="true", property="inline.failOnDuplicate") public boolean failOnDuplicateFail if any duplicate exists after processing the contents. -
outputJarFile
The path to the output file for the inlined artifact. When this parameter is set, the created archive will neither replace the project's main artifact nor will it be attached. Hence, this parameter causes the parametersinlinedArtifactAttached
,inlinedClassifierName
to be ignored when used. -
outputPomFile
The path to the output file for the new POM file. When this parameter is set, the created pom file will not replace the project's pom file. -
inlinedArtifactAttached
@Parameter(defaultValue="false", property="inline.attachArtifact") public boolean inlinedArtifactAttachedIf true, attach the inlined artifact, if false replace the original artifact. -
replacePomFile
@Parameter(defaultValue="true", property="inline.replacePomFile") public boolean replacePomFileIf true, replace the POM file with a new version that has all inlined dependencies removed. It is possible to write a POM file that works to build the jar with inlined dependencies and then use the same POM file for the resulting artifact (by having all dependencies marked as provided and ensure that those dependencies do not have additional, transitive dependencies. This tends to be error prone and it is recommended to have the plugin rewrite the POM file. -
inlinedClassifierName
The name of the classifier used in case the inlined artifact is attached.
-
-
Constructor Details
-
InlineMojo
public InlineMojo()
-
-
Method Details
-
setInlineDependencies
-
setIncludes
-
setExcludes
-
setAdditionalProcessors
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
isDependencyIncluded
public boolean isDependencyIncluded(org.eclipse.aether.graph.Dependency dependency)
-