Class JavadocJarMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.javadoc.AbstractJavadocMojo
org.apache.maven.plugins.javadoc.JavadocJarMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AggregatorJavadocJarMojo, TestJavadocJarMojo

@Mojo(name="jar", defaultPhase=PACKAGE, requiresDependencyResolution=COMPILE, threadSafe=true) public class JavadocJarMojo extends AbstractJavadocMojo
Bundles the Javadoc documentation for main Java code in an NON aggregator project into a jar using the standard Javadoc Tool.
Since:
2.0
  • Field Details

    • DEFAULT_INCLUDES

      private static final String[] DEFAULT_INCLUDES
      Includes all generated Javadoc files
    • DEFAULT_EXCLUDES

    • projectHelper

      private org.apache.maven.project.MavenProjectHelper projectHelper
      Used for attaching the artifact in the project.
    • jarArchiver

      private org.codehaus.plexus.archiver.jar.JarArchiver jarArchiver
      The Jar archiver.
      Since:
      2.5
    • jarOutputDirectory

      @Parameter(property="project.build.directory") private String jarOutputDirectory
      Specifies the directory where the generated jar file will be put.
    • finalName

      @Parameter(property="project.build.finalName") private String finalName
      Specifies the filename that will be used for the generated jar file. Please note that -javadoc or -test-javadoc will be appended to the file name.
    • attach

      @Parameter(property="attach", defaultValue="true") private boolean attach
      Specifies whether to attach the generated artifact to the project helper.
    • archive

      @Parameter private org.apache.maven.archiver.MavenArchiveConfiguration archive
      The archive configuration to use. See Maven Archiver Reference.
      Since:
      2.5
    • defaultManifestFile

      @Parameter(defaultValue="${project.build.outputDirectory}/META-INF/MANIFEST.MF", required=true, readonly=true) private File defaultManifestFile
      Path to the default MANIFEST file to use. It will be used if useDefaultManifestFile is set to true.
      Since:
      2.5
    • useDefaultManifestFile

      @Parameter(defaultValue="false") private boolean useDefaultManifestFile
      Set this to true to enable the use of the defaultManifestFile.
      Since:
      2.5
    • classifier

      @Parameter(property="maven.javadoc.classifier", defaultValue="javadoc", required=true) private String classifier
      Since:
      2.10
  • Constructor Details

    • JavadocJarMojo

      @Inject public JavadocJarMojo(org.apache.maven.project.MavenProjectHelper projectHelper, org.codehaus.plexus.archiver.jar.JarArchiver jarArchiver, org.apache.maven.doxia.tools.SiteTool siteTool, org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager, ResourceResolver resourceResolver, org.eclipse.aether.RepositorySystem repoSystem, org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager, org.apache.maven.project.ProjectBuilder mavenProjectBuilder, org.apache.maven.toolchain.ToolchainManager toolchainManager)
  • Method Details

    • doExecute

      protected void doExecute() throws org.apache.maven.plugin.MojoExecutionException
      Specified by:
      doExecute in class AbstractJavadocMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getClassifier

      protected String getClassifier()
      Returns:
      the wanted classifier, i.e. javadoc or test-javadoc
    • generateArchive

      private File generateArchive(File javadocFiles, String jarFileName) throws org.codehaus.plexus.archiver.ArchiverException, IOException
      Method that creates the jar file
      Parameters:
      javadocFiles - the directory where the generated jar file will be put
      jarFileName - the filename of the generated jar file
      Returns:
      a File object that contains the generated jar file
      Throws:
      org.codehaus.plexus.archiver.ArchiverException - ArchiverException
      IOException - IOException
    • isDetectOfflineLinks

      public boolean isDetectOfflineLinks()
      Overrides:
      isDetectOfflineLinks in class AbstractJavadocMojo