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 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

      @Parameter(defaultValue="${project.build.directory}") public File outputDirectory
      The destination directory for the inlined artifact.
    • pomFile

      @Parameter(property="inline.pomFile", defaultValue="${project.file}") public File pomFile
      The POM file to use.
    • hideClasses

      @Parameter(defaultValue="true", property="inline.hide-classes") public boolean hideClasses
      Hide inlined classes from IDE autocompletion.
    • skip

      @Parameter(defaultValue="false", property="inline.skip") public boolean skip
      Skip the execution.
    • quiet

      @Parameter(defaultValue="false", property="inline.quiet") public boolean quiet
      Silence all non-output and non-error messages.
    • prefix

      @Parameter(required=true, property="inline.prefix") public String 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 failOnNoMatch
      Fail if an inline dependency is defined but the corresponding dependency is not actually found.
    • failOnDuplicate

      @Parameter(defaultValue="true", property="inline.failOnDuplicate") public boolean failOnDuplicate
      Fail if any duplicate exists after processing the contents.
    • outputJarFile

      @Parameter public File 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 parameters inlinedArtifactAttached, inlinedClassifierName to be ignored when used.
    • outputPomFile

      @Parameter public File 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 inlinedArtifactAttached
      If true, attach the inlined artifact, if false replace the original artifact.
    • replacePomFile

      @Parameter(defaultValue="true", property="inline.replacePomFile") public boolean replacePomFile
      If 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

      @Parameter(defaultValue="inlined") public String inlinedClassifierName
      The name of the classifier used in case the inlined artifact is attached.
  • Constructor Details

    • InlineMojo

      public InlineMojo()
  • Method Details

    • setInlineDependencies

      public void setInlineDependencies(List<InlineDependency> inlineDependencies)
    • setIncludes

      public void setIncludes(List<ArtifactIdentifier> includes)
    • setExcludes

      public void setExcludes(List<ArtifactIdentifier> excludes)
    • setAdditionalProcessors

      public void setAdditionalProcessors(List<String> processors)
    • 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)