public abstract class AbstractJavadocMojo extends AbstractMojo
Modifier and Type | Field and Description |
---|---|
protected static String |
ARGFILE_FILE_NAME
The
argfile file name in the output directory when calling:
javadoc.exe(or .sh) @options @packages | @argfile | @files |
protected static String |
DEBUG_JAVADOC_SCRIPT_NAME
The Javadoc script file name when
debug parameter is on, i.e. |
static Properties |
DEFAULT_JAVA_API_LINKS
The default Javadoc API urls according the
Sun API
Specifications:
|
protected boolean |
failOnError
Specifies if the build will fail if there are errors during javadoc execution or not.
|
protected boolean |
failOnWarnings
Specifies if the build will fail if there are warning during javadoc execution or not.
|
protected static String |
FILES_FILE_NAME
The
files file name in the output directory when calling:
javadoc.exe(or .sh) @options @packages | @argfile | @files |
static String |
JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
Classifier used in the name of the javadoc-options XML file, and in the resources bundle
artifact that gets attached to the project.
|
protected ArrayList<String> |
links
Creates links to existing javadoc-generated documentation of external referenced classes.
|
protected static String |
OPTIONS_FILE_NAME
The
options file name in the output directory when calling:
javadoc.exe(or .sh) @options @packages | @argfile | @files |
protected File |
outputDirectory
Specifies the destination directory where javadoc saves the generated HTML files.
|
protected static String |
PACKAGES_FILE_NAME
The
packages file name in the output directory when calling:
javadoc.exe(or .sh) @options @packages | @argfile | @files |
protected MavenProject |
project
The Maven Project Object
|
protected MavenSession |
session
The current build session instance.
|
protected boolean |
skip
Specifies whether the Javadoc generation should be skipped.
|
static String |
TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
Classifier used in the name of the javadoc-options XML file, and in the resources bundle
artifact that gets attached to the project.
|
protected boolean |
useStandardDocletOptions
Specifies to use the
options provided by the Standard Doclet for a custom doclet.
|
Constructor and Description |
---|
AbstractJavadocMojo() |
Modifier and Type | Method and Description |
---|---|
protected JavadocOptions |
buildJavadocOptions()
Generate a javadoc-options XML file, for either bundling with a javadoc-resources artifact OR
supplying to a distro module in a includeDependencySources configuration, so the javadoc options
from this execution can be reconstructed and merged in the distro build.
|
protected boolean |
canGenerateReport(List<String> files)
Method that indicates whether the javadoc can be generated or not.
|
protected Collection<String> |
collect(Collection<Collection<String>> sourcePaths) |
protected SourceResolverConfig |
configureDependencySourceResolution(SourceResolverConfig config)
Override this method to customize the configuration for resolving dependency sources.
|
void |
execute() |
protected void |
executeReport(Locale unusedLocale)
The package documentation details the
Javadoc Options used by this Plugin.
|
protected void |
failOnError(String prefix,
Exception e) |
protected String |
getAttachmentClassifier()
Override this if you need to provide a bundle attachment classifier, as in the case of test
javadocs.
|
protected ScopeFilter |
getDependencyScopeFilter() |
protected Map<String,Collection<String>> |
getDependencySourcePaths()
Resolve dependency sources so they can be included directly in the javadoc process.
|
protected String |
getDoclint() |
protected String |
getDoctitle() |
protected List<String> |
getExecutionProjectSourceRoots(MavenProject p) |
protected List<String> |
getFiles(Collection<String> sourcePaths)
Method to get the files on the specified source paths
|
protected File |
getJavadocDirectory() |
protected File |
getJavadocOptionsFile()
Construct the output file for the generated javadoc-options XML file, after creating the
javadocOptionsDir if necessary.
|
protected String |
getOutputDirectory() |
protected File |
getOverview() |
protected MavenProject |
getProject() |
protected List<File> |
getProjectBuildOutputDirs(MavenProject p) |
protected List<String> |
getProjectSourceRoots(MavenProject p) |
protected Map<String,Collection<String>> |
getSourcePaths()
Method to get the source paths.
|
protected Toolchain |
getToolchain() |
protected String |
getWindowtitle() |
protected boolean |
isAggregator()
Indicates whether this goal is flagged with
@aggregator . |
protected boolean |
isTest()
Indicates whether this goal generates documentation for the
Java Test code . |
protected boolean |
isValidJavadocLink(String link,
boolean detecting) |
protected void |
logError(String message,
Throwable t)
Logs an error with throwable content only if in debug.
|
Artifact |
resolveDependency(Dependency dependency) |
protected void |
verifyRemovedParameter(String paramName) |
getLog, getPluginContext, setLog, setPluginContext
public static final String JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
,
Constant Field Valuespublic static final String TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
,
Constant Field Valuespublic static final Properties DEFAULT_JAVA_API_LINKS
<javaApiLinks> <property> <name>api_1.3</name> <value>http://docs.oracle.com/javase/1.3/docs/api/</value> </property> <property> <name>api_1.4</name> <value>http://docs.oracle.com/javase/1.4.2/docs/api/</value> </property> <property> <name>api_1.5</name> <value>http://docs.oracle.com/javase/1.5.0/docs/api/</value> </property> <property> <name>api_1.6</name> <value>http://docs.oracle.com/javase/6/docs/api/</value> </property> <property> <name>api_1.7</name> <value>http://docs.oracle.com/javase/7/docs/api/</value> </property> <property> <name>api_1.8</name> <value>http://docs.oracle.com/javase/8/docs/api/</value> </property> </javaApiLinks>
protected static final String DEBUG_JAVADOC_SCRIPT_NAME
debug
parameter is on, i.e. javadoc.bat or javadoc.shprotected static final String OPTIONS_FILE_NAME
options
file name in the output directory when calling:
javadoc.exe(or .sh) @options @packages | @argfile | @files
protected static final String PACKAGES_FILE_NAME
packages
file name in the output directory when calling:
javadoc.exe(or .sh) @options @packages | @argfile | @files
protected static final String ARGFILE_FILE_NAME
argfile
file name in the output directory when calling:
javadoc.exe(or .sh) @options @packages | @argfile | @files
protected static final String FILES_FILE_NAME
files
file name in the output directory when calling:
javadoc.exe(or .sh) @options @packages | @argfile | @files
@Parameter(defaultValue="${session}", readonly=true, required=true) protected MavenSession session
@Parameter(defaultValue="${project}", readonly=true, required=true) protected MavenProject project
@Parameter(property="maven.javadoc.skip", defaultValue="false") protected boolean skip
@Parameter(property="maven.javadoc.failOnError", defaultValue="true") protected boolean failOnError
@Parameter(property="maven.javadoc.failOnWarnings", defaultValue="false") protected boolean failOnWarnings
@Parameter(property="useStandardDocletOptions", defaultValue="true") protected boolean useStandardDocletOptions
<docletArtifacts> <docletArtifact> <groupId>com.sun.tools.doclets</groupId> <artifactId>doccheck</artifactId> <version>1.2b2</version> </docletArtifact> </docletArtifacts> <useStandardDocletOptions>true</useStandardDocletOptions>
@Parameter(property="links") protected ArrayList<String> links
isOffline
is set to false
./package-list
file. For instance:
<links> <link>http://docs.oracle.com/javase/1.4.2/docs/api</link> <links>will be used because
http://docs.oracle.com/javase/1.4.2/docs/api/package-list
exists.detectLinks
is defined, the links between the project dependencies are
automatically added.detectJavaApiLink
is defined, a Java API link, based on the Java version of the
project's sources, will be added automatically.detectLinks
,
detectJavaApiLink
@Parameter(property="destDir", alias="destDir", defaultValue="${project.build.directory}/apidocs", required=true) protected File outputDirectory
protected boolean isAggregator()
@aggregator
.true
if the goal is designed as an aggregator, false
otherwise.AggregatorJavadocReport
,
AggregatorTestJavadocReport
protected boolean isTest()
Java Test code
.true
if the goal generates Test Javadocs, false
otherwise.protected String getOutputDirectory()
protected MavenProject getProject()
protected List<File> getProjectBuildOutputDirs(MavenProject p)
p
- not null maven projectprotected List<String> getProjectSourceRoots(MavenProject p)
p
- not null maven projectprotected List<String> getExecutionProjectSourceRoots(MavenProject p)
p
- not null maven projectprotected File getJavadocDirectory()
protected String getDoclint()
protected String getDoctitle()
protected File getOverview()
javadocdirectory
protected String getWindowtitle()
public void execute() throws MojoExecutionException, MojoFailureException
protected final void verifyRemovedParameter(String paramName)
protected void executeReport(Locale unusedLocale) throws MavenReportException
unusedLocale
- the wanted locale (actually unused).MavenReportException
- if anyprotected final Collection<String> collect(Collection<Collection<String>> sourcePaths)
protected List<String> getFiles(Collection<String> sourcePaths) throws MavenReportException
sourcePaths
- a Collection that contains the paths to the source filesMavenReportException
- MavenReportException
protected Map<String,Collection<String>> getSourcePaths() throws MavenReportException
String
MavenReportException
- MavenReportException
JavadocUtil.pruneDirs(MavenProject, Collection)
protected SourceResolverConfig configureDependencySourceResolution(SourceResolverConfig config)
config
- SourceResolverConfig
SourceResolverConfig
protected final Map<String,Collection<String>> getDependencySourcePaths() throws MavenReportException
configureDependencySourceResolution(SourceResolverConfig)
.MavenReportException
- MavenReportException
protected boolean canGenerateReport(List<String> files)
files
- the project filesprotected ScopeFilter getDependencyScopeFilter()
public Artifact resolveDependency(Dependency dependency) throws MavenReportException
dependency
- Dependency
Artifact
MavenReportException
- when artifact could not be resolvedprotected final Toolchain getToolchain()
protected boolean isValidJavadocLink(String link, boolean detecting)
link
- not nulldetecting
- true
if the link is generated by
detectLinks
, or false
otherwisetrue
if the link has a /package-list
, false
otherwise.protected final File getJavadocOptionsFile()
File
file.protected final JavadocOptions buildJavadocOptions() throws IOException
JavadocOptions
IOException
- IOException
protected String getAttachmentClassifier()
protected void logError(String message, Throwable t)
message
- The message which should be announced.t
- The throwable part of the message.protected void failOnError(String prefix, Exception e) throws MojoExecutionException
prefix
- The prefix of the exception.e
- The exception.MojoExecutionException
- MojoExecutionException
Copyright © 2004–2018 The Apache Software Foundation. All rights reserved.