org.apache.maven.plugin.javadoc
Class AbstractJavadocMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.javadoc.AbstractJavadocMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
JavadocJar, JavadocReport

public abstract class AbstractJavadocMojo
extends org.apache.maven.plugin.AbstractMojo

Base class with majority of Javadoc functionalities.

Since:
2.0
Version:
$Id: AbstractJavadocMojo.html 829392 2012-08-19 17:29:37Z hboutemy $
Author:
Brett Porter, Vincent Siveton
See Also:
The Java API Documentation Generator, 1.4.2
Requires the dependencies in this specified scope:
compile

Field Summary
protected  boolean aggregate
          Deprecated. since 2.5. Use the goals javadoc:aggregate and javadoc:test-aggregate instead.
protected static java.lang.String ARGFILE_FILE_NAME
          The argfile file name in the output directory when calling: javadoc.exe(or .sh) @options @packages | @argfile | @files
protected static java.lang.String DEBUG_JAVADOC_SCRIPT_NAME
          The Javadoc script file name when debug parameter is on, i.e. javadoc.bat or javadoc.sh
static java.util.Properties DEFAULT_JAVA_API_LINKS
          The default Javadoc API urls according the Sun API Specifications: <javaApiLinks> <property> <name>api_1.3</name> <value>http://java.sun.com/j2se/1.3/docs/api</value> </property> <property> <name>api_1.4</name> <value>http://java.sun.com/j2se/1.4.2/docs/api/</value> </property> <property> <name>api_1.5</name> <value>http://java.sun.com/j2se/1.5.0/docs/api/</value> </property> <property> <name>api_1.6</name> <value>http://java.sun.com/javase/6/docs/api/</value> </property> </javaApiLinks>
protected  boolean failOnError
          Specifies whether the build will continue even if there are errors.
protected static java.lang.String FILES_FILE_NAME
          The files file name in the output directory when calling: javadoc.exe(or .sh) @options @packages | @argfile | @files
protected  java.util.ArrayList links
          Creates links to existing javadoc-generated documentation of external referenced classes.
protected static java.lang.String OPTIONS_FILE_NAME
          The options file name in the output directory when calling: javadoc.exe(or .sh) @options @packages | @argfile | @files
protected  java.io.File outputDirectory
          Specifies the destination directory where javadoc saves the generated HTML files.
protected static java.lang.String PACKAGES_FILE_NAME
          The packages file name in the output directory when calling: javadoc.exe(or .sh) @options @packages | @argfile | @files
protected  org.apache.maven.project.MavenProject project
          The Maven Project Object
protected  boolean skip
          Specifies whether the Javadoc generation should be skipped.
protected  boolean useStandardDocletOptions
          Specifies to use the options provided by the Standard Doclet for a custom doclet.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractJavadocMojo()
           
 
Method Summary
protected  boolean canGenerateReport(java.util.List files)
          Method that indicates whether the javadoc can be generated or not.
protected  void executeReport(java.util.Locale unusedLocale)
          The package documentation details the Javadoc Options used by this Plugin.
protected  java.util.List getCompileArtifacts(org.apache.maven.artifact.resolver.ArtifactResolutionResult result)
           
protected  java.lang.String getDoctitle()
           
protected  java.util.List getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p)
           
protected  java.util.List getFiles(java.util.List sourcePaths)
          Method to get the files on the specified source paths
protected  java.io.File getJavadocDirectory()
           
protected  java.lang.String getOutputDirectory()
           
protected  java.io.File getOverview()
           
protected  java.util.List getProjectArtifacts(org.apache.maven.project.MavenProject p)
           
protected  java.util.List getProjectBuildOutputDirs(org.apache.maven.project.MavenProject p)
           
protected  java.util.List getProjectSourceRoots(org.apache.maven.project.MavenProject p)
           
protected  java.util.List getSourcePaths()
          Method to get the source paths.
protected  java.lang.String getWindowtitle()
           
protected  boolean isAggregator()
          Indicates whether this goal is flagged with @aggregator.
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

DEFAULT_JAVA_API_LINKS

public static final java.util.Properties DEFAULT_JAVA_API_LINKS
The default Javadoc API urls according the Sun API Specifications:
 <javaApiLinks>
   <property>
     <name>api_1.3</name>
     <value>http://java.sun.com/j2se/1.3/docs/api</value>
   </property>
   <property>
     <name>api_1.4</name>
     <value>http://java.sun.com/j2se/1.4.2/docs/api/</value>
   </property>
   <property>
     <name>api_1.5</name>
     <value>http://java.sun.com/j2se/1.5.0/docs/api/</value>
   </property>
   <property>
     <name>api_1.6</name>
     <value>http://java.sun.com/javase/6/docs/api/</value>
   </property>
 </javaApiLinks>
 

Since:
2.6

DEBUG_JAVADOC_SCRIPT_NAME

protected static final java.lang.String DEBUG_JAVADOC_SCRIPT_NAME
The Javadoc script file name when debug parameter is on, i.e. javadoc.bat or javadoc.sh


OPTIONS_FILE_NAME

protected static final java.lang.String OPTIONS_FILE_NAME
The options file name in the output directory when calling: javadoc.exe(or .sh) @options @packages | @argfile | @files

See Also:
Constant Field Values

PACKAGES_FILE_NAME

protected static final java.lang.String PACKAGES_FILE_NAME
The packages file name in the output directory when calling: javadoc.exe(or .sh) @options @packages | @argfile | @files

See Also:
Constant Field Values

ARGFILE_FILE_NAME

protected static final java.lang.String ARGFILE_FILE_NAME
The argfile file name in the output directory when calling: javadoc.exe(or .sh) @options @packages | @argfile | @files

See Also:
Constant Field Values

FILES_FILE_NAME

protected static final java.lang.String FILES_FILE_NAME
The files file name in the output directory when calling: javadoc.exe(or .sh) @options @packages | @argfile | @files

See Also:
Constant Field Values

project

protected org.apache.maven.project.MavenProject project
The Maven Project Object

Is defined by:
expression:
${project}
Is readonly.
Is required.

aggregate

protected boolean aggregate
Deprecated. since 2.5. Use the goals javadoc:aggregate and javadoc:test-aggregate instead.
Whether to build an aggregated report at the root, or build individual reports.

Is defined by:
expression:
${aggregate}
default-value:
false

skip

protected boolean skip
Specifies whether the Javadoc generation should be skipped.

Since:
2.5
Is defined by:
expression:
${maven.javadoc.skip}
default-value:
false

failOnError

protected boolean failOnError
Specifies whether the build will continue even if there are errors.

Since:
2.5
Is defined by:
expression:
${maven.javadoc.failOnError}
default-value:
true

useStandardDocletOptions

protected boolean useStandardDocletOptions
Specifies to use the options provided by the Standard Doclet for a custom doclet.
Example:
 <docletArtifacts>
   <docletArtifact>
     <groupId>com.sun.tools.doclets</groupId>
     <artifactId>doccheck</artifactId>
     <version>1.2b2</version>
   </docletArtifact>
 </docletArtifacts>
 <useStandardDocletOptions>true</useStandardDocletOptions>
 

Since:
2.5
Is defined by:
expression:
${useStandardDocletOptions}
default-value:
true

links

protected java.util.ArrayList links
Creates links to existing javadoc-generated documentation of external referenced classes.
Note 1: only used is isOffline is set to false.
Note 2: all given links should have a fetchable /package-list file. For instance:
 <links>
   <link>http://java.sun.com/j2se/1.4.2/docs/api</link>
 <links>
 
will be used because http://java.sun.com/j2se/1.4.2/docs/api/package-list exists.
Note 1: if detectLinks is defined, the links between the project dependencies are automatically added. Note 2: if detectJavaApiLink is defined, a Java API link, based on the Java verion of the project's sources, will be added automatically.
See link.

See Also:
detectLinks, detectJavaApiLink
Is defined by:
expression:
${links}

outputDirectory

protected java.io.File outputDirectory
Specifies the destination directory where javadoc saves the generated HTML files.
See d.

Is defined by:
default-value:
${project.build.directory}/apidocs
expression:
${destDir}
alias:
destDir
Is required.
Constructor Detail

AbstractJavadocMojo

public AbstractJavadocMojo()
Method Detail

isAggregator

protected boolean isAggregator()
Indicates whether this goal is flagged with @aggregator.

Returns:
true if the goal is designed as an aggregator, false otherwise.
See Also:
AggregatorJavadocReport, AggregatorTestJavadocReport

getOutputDirectory

protected java.lang.String getOutputDirectory()
Returns:
the output directory

getProjectBuildOutputDirs

protected java.util.List getProjectBuildOutputDirs(org.apache.maven.project.MavenProject p)
Parameters:
p - not null maven project
Returns:
the list of directories where compiled classes are placed for the given project. These dirs are added in the javadoc classpath.

getProjectSourceRoots

protected java.util.List getProjectSourceRoots(org.apache.maven.project.MavenProject p)
Parameters:
p - not null maven project
Returns:
the list of source paths for the given project

getExecutionProjectSourceRoots

protected java.util.List getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p)
Parameters:
p - not null maven project
Returns:
the list of source paths for the execution project of the given project

getProjectArtifacts

protected java.util.List getProjectArtifacts(org.apache.maven.project.MavenProject p)
Parameters:
p - not null maven project
Returns:
the list of artifacts for the given project

getJavadocDirectory

protected java.io.File getJavadocDirectory()
Returns:
the current javadoc directory

getDoctitle

protected java.lang.String getDoctitle()
Returns:
the title to be placed near the top of the overview summary file

getOverview

protected java.io.File getOverview()
Returns:
the overview documentation file from the user parameter or from the javadocdirectory

getWindowtitle

protected java.lang.String getWindowtitle()
Returns:
the title to be placed in the HTML title tag

executeReport

protected void executeReport(java.util.Locale unusedLocale)
                      throws org.apache.maven.reporting.MavenReportException
The package documentation details the Javadoc Options used by this Plugin.

Parameters:
unusedLocale - the wanted locale (actually unused).
Throws:
org.apache.maven.reporting.MavenReportException - if any

getFiles

protected java.util.List getFiles(java.util.List sourcePaths)
Method to get the files on the specified source paths

Parameters:
sourcePaths - a List that contains the paths to the source files
Returns:
a List that contains the specific path for every source file

getSourcePaths

protected java.util.List getSourcePaths()
Method to get the source paths. If no source path is specified in the parameter, the compile source roots of the project will be used.

Returns:
a List of the project absolute source paths as String
See Also:
JavadocUtil.pruneDirs(MavenProject, List)

canGenerateReport

protected boolean canGenerateReport(java.util.List files)
Method that indicates whether the javadoc can be generated or not. If the project does not contain any source files and no subpackages are specified, the plugin will terminate.

Parameters:
files - the project files
Returns:
a boolean that indicates whether javadoc report can be generated or not

getCompileArtifacts

protected java.util.List getCompileArtifacts(org.apache.maven.artifact.resolver.ArtifactResolutionResult result)
Parameters:
result - not null
Returns:
the compile artifacts from the result
See Also:
JavadocUtil.getCompileArtifacts(Set, boolean)


Copyright © 2004-2009 The Apache Software Foundation. All Rights Reserved.