Package org.apache.maven.plugins.javadoc
Class TestJavadocReport
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.javadoc.AbstractJavadocMojo
-
- org.apache.maven.plugins.javadoc.JavadocReport
-
- org.apache.maven.plugins.javadoc.TestJavadocReport
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,org.apache.maven.reporting.MavenReport
- Direct Known Subclasses:
AggregatorTestJavadocReport
,TestJavadocNoForkReport
@Mojo(name="test-javadoc", requiresDependencyResolution=TEST, threadSafe=true) @Execute(phase=GENERATE_TEST_SOURCES) public class TestJavadocReport extends JavadocReport
Generates documentation for theJava Test code
in an NON aggregator project using the standard Javadoc Tool.- Since:
- 2.3
- See Also:
- Javadoc Tool, Javadoc Options
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
destDir
The name of the destination directory.private java.io.File
reportOutputDirectory
Specifies the destination directory where test Javadoc saves the generated HTML files.private java.lang.String
testDescription
The description of the Test Javadoc report to be displayed in the Maven Generated Reports page (i.e.private java.lang.String
testDoctitle
Specifies the Test title to be placed near the top of the overview summary file.private java.io.File
testJavadocDirectory
Specifies the Test Javadoc resources directory to be included in the Javadoc (i.e.private java.lang.String
testName
The name of the Test Javadoc report to be displayed in the Maven Generated Reports page (i.e.private java.io.File
testOverview
Specifies that Javadoc should retrieve the text for the Test overview documentation from the "source" file specified by path/filename and place it on the Overview page (overview-summary.html).private java.lang.String
testWindowtitle
Specifies the Test title to be placed in the HTML title tag.-
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 TestJavadocReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addMainJavadocLink()
Add the../apidocs
to the links parameter so Test report could be linked to the Main report.protected SourceResolverConfig
configureDependencySourceResolution(SourceResolverConfig config)
Overridden to enable the resolution of -test-sources jar files.protected void
executeReport(java.util.Locale unusedLocale)
The package documentation details the Javadoc Options used by this Plugin.private java.util.ResourceBundle
getBundle(java.util.Locale locale)
Gets the resource bundle for the specified locale.protected org.apache.maven.shared.artifact.filter.resolve.ScopeFilter
getDependencyScopeFilter()
java.lang.String
getDescription(java.util.Locale locale)
protected java.lang.String
getDoctitle()
protected java.util.List<java.lang.String>
getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p)
protected java.io.File
getJavadocDirectory()
java.lang.String
getName(java.util.Locale locale)
java.lang.String
getOutputName()
protected java.io.File
getOverview()
protected java.util.List<java.io.File>
getProjectBuildOutputDirs(org.apache.maven.project.MavenProject p)
protected java.util.List<java.lang.String>
getProjectSourceRoots(org.apache.maven.project.MavenProject p)
java.io.File
getReportOutputDirectory()
protected java.lang.String
getWindowtitle()
protected boolean
isTest()
Indicates whether this goal generates documentation for theJava Test code
.void
setDestDir(java.lang.String destDir)
void
setReportOutputDirectory(java.io.File reportOutputDirectory)
Method to set the directory where the generated reports will be putprivate void
updateReportOutputDirectory(java.io.File reportOutputDirectory, java.lang.String destDir)
-
Methods inherited from class org.apache.maven.plugins.javadoc.JavadocReport
canGenerateReport, doExecute, generate, getCategoryName, isExternalReport
-
Methods inherited from class org.apache.maven.plugins.javadoc.AbstractJavadocMojo
buildJavadocOptions, canGenerateReport, collect, execute, failOnError, getArtifactFile, getAttachmentClassifier, getDefaultJavadocApiLink, getDependencySourcePaths, getDoclint, getFiles, getJavadocOptionsFile, getOutputDirectory, getProject, getSourcePaths, getToolchain, isAggregator, isSkippedJavadoc, isSkippedModule, isValidJavadocLink, logError, resolveDependency, verifyRemovedParameter
-
-
-
-
Field Detail
-
testDoctitle
@Parameter(property="testDoctitle", alias="doctitle", defaultValue="${project.name} ${project.version} Test API") private java.lang.String testDoctitle
- Since:
- 2.5
-
testOverview
@Parameter(property="testOverview", alias="overview", defaultValue="${basedir}/src/test/javadoc/overview.html") private java.io.File testOverview
Specifies that Javadoc should retrieve the text for the Test overview documentation from the "source" file specified by path/filename and place it on the Overview page (overview-summary.html).
Note: could be in conflict with <nooverview/>.
See overview.- Since:
- 2.5
-
testWindowtitle
@Parameter(property="testWindowtitle", alias="windowtitle", defaultValue="${project.name} ${project.version} Test API") private java.lang.String testWindowtitle
- Since:
- 2.5
-
reportOutputDirectory
@Parameter(property="reportTestOutputDirectory", defaultValue="${project.reporting.outputDirectory}/testapidocs", required=true) private java.io.File reportOutputDirectory
Specifies the destination directory where test Javadoc saves the generated HTML files.
-
destDir
@Parameter(property="destDir", defaultValue="testapidocs") private java.lang.String destDir
The name of the destination directory.
-
testJavadocDirectory
@Parameter(alias="javadocDirectory", defaultValue="${basedir}/src/test/javadoc") private java.io.File testJavadocDirectory
Specifies the Test Javadoc resources directory to be included in the Javadoc (i.e. package.html, images...).
Could be used in addition ofdocfilessubdirs
parameter.
See docfilessubdirs.- Since:
- 2.5
-
testName
@Parameter(property="testName", alias="name") private java.lang.String testName
The name of the Test Javadoc report to be displayed in the Maven Generated Reports page (i.e.project-reports.html
).- Since:
- 2.5
-
testDescription
@Parameter(property="testDescription", alias="description") private java.lang.String testDescription
The description of the Test Javadoc report to be displayed in the Maven Generated Reports page (i.e.project-reports.html
).- Since:
- 2.5
-
-
Method Detail
-
executeReport
protected void executeReport(java.util.Locale unusedLocale) throws org.apache.maven.reporting.MavenReportException
Description copied from class:AbstractJavadocMojo
The package documentation details the Javadoc Options used by this Plugin.- Overrides:
executeReport
in classAbstractJavadocMojo
- Parameters:
unusedLocale
- the wanted locale (actually unused).- Throws:
org.apache.maven.reporting.MavenReportException
- if any
-
getName
public java.lang.String getName(java.util.Locale locale)
Description copied from class:JavadocReport
- Specified by:
getName
in interfaceorg.apache.maven.reporting.MavenReport
- Overrides:
getName
in classJavadocReport
-
getDescription
public java.lang.String getDescription(java.util.Locale locale)
Description copied from class:JavadocReport
- Specified by:
getDescription
in interfaceorg.apache.maven.reporting.MavenReport
- Overrides:
getDescription
in classJavadocReport
-
getOutputName
public java.lang.String getOutputName()
Description copied from class:JavadocReport
- Specified by:
getOutputName
in interfaceorg.apache.maven.reporting.MavenReport
- Overrides:
getOutputName
in classJavadocReport
-
getReportOutputDirectory
public java.io.File getReportOutputDirectory()
Description copied from class:JavadocReport
- Specified by:
getReportOutputDirectory
in interfaceorg.apache.maven.reporting.MavenReport
- Overrides:
getReportOutputDirectory
in classJavadocReport
-
setReportOutputDirectory
public void setReportOutputDirectory(java.io.File reportOutputDirectory)
Method to set the directory where the generated reports will be put- Specified by:
setReportOutputDirectory
in interfaceorg.apache.maven.reporting.MavenReport
- Overrides:
setReportOutputDirectory
in classJavadocReport
- Parameters:
reportOutputDirectory
- the directory file to be set
-
setDestDir
public void setDestDir(java.lang.String destDir)
- Overrides:
setDestDir
in classJavadocReport
- Parameters:
destDir
- The destination directory.
-
updateReportOutputDirectory
private void updateReportOutputDirectory(java.io.File reportOutputDirectory, java.lang.String destDir)
-
getProjectBuildOutputDirs
protected java.util.List<java.io.File> getProjectBuildOutputDirs(org.apache.maven.project.MavenProject p)
- Overrides:
getProjectBuildOutputDirs
in classAbstractJavadocMojo
- 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<java.lang.String> getProjectSourceRoots(org.apache.maven.project.MavenProject p)
- Overrides:
getProjectSourceRoots
in classAbstractJavadocMojo
- Parameters:
p
- not null maven project- Returns:
- the list of source paths for the given project
-
getExecutionProjectSourceRoots
protected java.util.List<java.lang.String> getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p)
- Overrides:
getExecutionProjectSourceRoots
in classAbstractJavadocMojo
- Parameters:
p
- not null maven project- Returns:
- the list of source paths for the execution project of the given project
-
getJavadocDirectory
protected java.io.File getJavadocDirectory()
- Overrides:
getJavadocDirectory
in classAbstractJavadocMojo
- Returns:
- the current javadoc directory
-
getDoctitle
protected java.lang.String getDoctitle()
- Overrides:
getDoctitle
in classAbstractJavadocMojo
- Returns:
- the title to be placed near the top of the overview summary file
-
getOverview
protected java.io.File getOverview()
- Overrides:
getOverview
in classAbstractJavadocMojo
- Returns:
- the overview documentation file from the user parameter or from the
javadocdirectory
-
getWindowtitle
protected java.lang.String getWindowtitle()
- Overrides:
getWindowtitle
in classAbstractJavadocMojo
- Returns:
- the title to be placed in the HTML title tag
-
getDependencyScopeFilter
protected org.apache.maven.shared.artifact.filter.resolve.ScopeFilter getDependencyScopeFilter()
- Overrides:
getDependencyScopeFilter
in classAbstractJavadocMojo
-
getBundle
private java.util.ResourceBundle getBundle(java.util.Locale locale)
Gets the resource bundle for the specified locale.- Parameters:
locale
- The locale of the currently generated report.- Returns:
- The resource bundle for the requested locale.
-
addMainJavadocLink
private void addMainJavadocLink()
Add the../apidocs
to the links parameter so Test report could be linked to the Main report.
-
configureDependencySourceResolution
protected SourceResolverConfig configureDependencySourceResolution(SourceResolverConfig config)
Overridden to enable the resolution of -test-sources jar files. Override this method to customize the configuration for resolving dependency sources. The default behavior enables the resolution of -sources jar files.- Overrides:
configureDependencySourceResolution
in classAbstractJavadocMojo
- Parameters:
config
-SourceResolverConfig
- Returns:
SourceResolverConfig
-
isTest
protected boolean isTest()
Description copied from class:AbstractJavadocMojo
Indicates whether this goal generates documentation for theJava Test code
.- Overrides:
isTest
in classAbstractJavadocMojo
- Returns:
true
if the goal generates Test Javadocs,false
otherwise.
-
-