Package org.apache.maven.plugins.javadoc
Class JavadocJar
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.javadoc.AbstractJavadocMojo
-
- org.apache.maven.plugins.javadoc.JavadocJar
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AggregatorJavadocJar
,TestJavadocJar
@Mojo(name="jar", defaultPhase=PACKAGE, requiresDependencyResolution=COMPILE, threadSafe=true) public class JavadocJar extends AbstractJavadocMojo
Bundles the Javadoc documentation formain Java code
in an NON aggregator project into a jar using the standard Javadoc Tool.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.maven.archiver.MavenArchiveConfiguration
archive
The archive configuration to use.private boolean
attach
Specifies whether to attach the generated artifact to the project helper.private java.lang.String
classifier
private static java.lang.String[]
DEFAULT_EXCLUDES
Excludes all processing files.private static java.lang.String[]
DEFAULT_INCLUDES
Includes all generated Javadoc filesprivate java.io.File
defaultManifestFile
Path to the default MANIFEST file to use.private java.io.File
destDir
Deprecated.private java.lang.String
finalName
Specifies the filename that will be used for the generated jar file.private org.codehaus.plexus.archiver.jar.JarArchiver
jarArchiver
The Jar archiver.private java.lang.String
jarOutputDirectory
Specifies the directory where the generated jar file will be put.private java.lang.String
outputTimestamp
Timestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXX
or as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).private org.apache.maven.project.MavenProjectHelper
projectHelper
Used for attaching the artifact in the project.private boolean
useDefaultManifestFile
Set this totrue
to enable the use of thedefaultManifestFile
.-
Fields inherited from class org.apache.maven.plugins.javadoc.AbstractJavadocMojo
ARGFILE_FILE_NAME, DEBUG_JAVADOC_SCRIPT_NAME, failOnError, failOnWarnings, FILES_FILE_NAME, JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER, links, locationManager, OPTIONS_FILE_NAME, outputDirectory, PACKAGES_FILE_NAME, project, session, skip, TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER, useStandardDocletOptions
-
-
Constructor Summary
Constructors Constructor Description JavadocJar()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doExecute()
private java.io.File
generateArchive(java.io.File javadocFiles, java.lang.String jarFileName)
Method that creates the jar fileprotected java.lang.String
getClassifier()
-
Methods inherited from class org.apache.maven.plugins.javadoc.AbstractJavadocMojo
buildJavadocOptions, canGenerateReport, collect, configureDependencySourceResolution, execute, executeReport, failOnError, getArtifactFile, getAttachmentClassifier, getDefaultJavadocApiLink, getDependencyScopeFilter, getDependencySourcePaths, getDoclint, getDoctitle, getExecutionProjectSourceRoots, getFiles, getJavadocDirectory, getJavadocOptionsFile, getOutputDirectory, getOverview, getProject, getProjectBuildOutputDirs, getProjectSourceRoots, getSourcePaths, getToolchain, getWindowtitle, isAggregator, isSkippedJavadoc, isSkippedModule, isTest, isValidJavadocLink, logError, resolveDependency, verifyRemovedParameter
-
-
-
-
Field Detail
-
DEFAULT_INCLUDES
private static final java.lang.String[] DEFAULT_INCLUDES
Includes all generated Javadoc files
-
DEFAULT_EXCLUDES
private static final java.lang.String[] DEFAULT_EXCLUDES
Excludes all processing files.
-
projectHelper
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
Used for attaching the artifact in the project.
-
jarArchiver
@Component(role=org.codehaus.plexus.archiver.Archiver.class, hint="jar") private org.codehaus.plexus.archiver.jar.JarArchiver jarArchiver
The Jar archiver.- Since:
- 2.5
-
destDir
@Deprecated @Parameter(property="destDir") private java.io.File destDir
Deprecated.Specifies the destination directory where javadoc saves the generated HTML files. See d.
-
jarOutputDirectory
@Parameter(property="project.build.directory") private java.lang.String jarOutputDirectory
Specifies the directory where the generated jar file will be put.
-
finalName
@Parameter(property="project.build.finalName") private java.lang.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 java.io.File defaultManifestFile
Path to the default MANIFEST file to use. It will be used ifuseDefaultManifestFile
is set totrue
.- Since:
- 2.5
-
useDefaultManifestFile
@Parameter(defaultValue="false") private boolean useDefaultManifestFile
Set this totrue
to enable the use of thedefaultManifestFile
.- Since:
- 2.5
-
classifier
@Parameter(property="maven.javadoc.classifier", defaultValue="javadoc", required=true) private java.lang.String classifier
- Since:
- 2.10
-
outputTimestamp
@Parameter(defaultValue="${project.build.outputTimestamp}") private java.lang.String outputTimestamp
Timestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXX
or as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).- Since:
- 3.2.0
-
-
Method Detail
-
doExecute
public void doExecute() throws org.apache.maven.plugin.MojoExecutionException
- Specified by:
doExecute
in classAbstractJavadocMojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getClassifier
protected java.lang.String getClassifier()
- Returns:
- the wanted classifier, i.e.
javadoc
ortest-javadoc
-
generateArchive
private java.io.File generateArchive(java.io.File javadocFiles, java.lang.String jarFileName) throws org.codehaus.plexus.archiver.ArchiverException, java.io.IOException
Method that creates the jar file- Parameters:
javadocFiles
- the directory where the generated jar file will be putjarFileName
- the filename of the generated jar file- Returns:
- a File object that contains the generated jar file
- Throws:
org.codehaus.plexus.archiver.ArchiverException
-ArchiverException
java.io.IOException
-IOException
-
-