Class AbstractJavadocMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.javadoc.AbstractJavadocMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
JavadocJarMojo, JavadocReport, ResourcesBundleMojo
public abstract class AbstractJavadocMojo
extends org.apache.maven.plugin.AbstractMojo
Base class with the majority of Javadoc functionality.
- Since:
- 2.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<AdditionalDependency> Capability to add additional dependencies to the javadoc classpath.private StringSets additional Javadoc options (e.g.private String[]Sets additional Javadoc options for the execution of the javadoc command via the '-J' option to javadoc.private String[]Set an additional option(s) on the command line.private String[]Specifies the path of an additional HTML stylesheet file relative to thejavadocDirectoryExample:private booleanDeprecated.the security fix this applied is not needed in Java 8+ or the most recent versions of JDK 6 and 7.private org.codehaus.plexus.archiver.manager.ArchiverManagerArchiver managerprotected static final StringTheargfilefile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @filesprivate org.apache.maven.artifact.handler.manager.ArtifactHandlerManagerprivate booleanSpecifies whether the author text is included in the generated Javadocs.private StringSpecifies the paths where the boot classes reside.private BootclasspathArtifact[]Specifies the artifacts where the boot classes reside.private StringSpecifies the text to be placed at the bottom of each output file.
If you want to use html, you have to put it in a CDATA section,
e.g.private booleanUses the sentence break iterator to determine the end of the first sentence.private StringSpecifies the HTML character set for this document.private booleanSet this totrueto debug the Javadoc plugin.protected static final StringThe Javadoc script file name whendebugparameter is on, i.e.private static final StringDefault CSS file name, used as file name in the output directory for the temporary custom stylesheet file loaded from classloader resources.private List<JavadocBundle> Transient variable to allow lazy-resolution of javadoc bundles from dependencies, so they can be used at various points in the javadoc generation process.private List<DependencyLink> Redefine the apidoc URL for specific dependencies when usingdetectLinks.List of excluded dependency-source patterns.List of included dependency-source patterns.private booleanDetect the Java API link for the current build, e.g.private booleanDetect the Javadoc links for all dependencies defined in the project.private booleanDetect the links for all modules defined in the project.private booleanFrom jdk 23, javadoc now include some extra css, files which can increase the size of javadoc jar.private booleanWhen using legacyMode and aggregated javadoc, users may have a mix of Maven modules with module files and not.private StringSpecifies the encoding of the generated HTML files.private booleanEnables deep copying of the**/doc-filesdirectories and the specificresourcesdirectory from thejavadocDirectorydirectory (for instance,src/main/javadoc/com/mycompany/myapp/doc-filesandsrc/main/javadoc/resources).private StringSpecifies the class file that starts the doclet used in generating the documentation.private DocletArtifactSpecifies the artifact containing the doclet starting class file (specified with thedocletoption).private DocletArtifact[]Specifies multiple artifacts containing the path for the doclet starting class file (specified with thedocletoption).private StringSpecifies the path to the doclet starting class file (specified with thedocletoption) and any jar files it depends on.private StringSpecifies specific checks to be performed on Javadoc comments.private StringSpecifies the title to be placed near the top of the overview summary file.private static final Stringprivate StringSpecifies the encoding name of the source files.private StringExcludes any "doc-files" subdirectories with the given names.private StringUnconditionally excludes the specified packages and their subpackages from the list formed by-subpackages.private StringSpecifies the directories where extension classes reside.protected booleanSpecifies if the build will fail if there are errors during javadoc execution or not.protected booleanSpecifies if the build will fail if there are warning during javadoc execution or not.protected static final StringThefilesfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @filesprivate StringSpecifies the footer text to be placed at the bottom of each output file.private booleanForces the Javadoc JVM locale to beLocale.ROOT.private Group[]Separates packages on the overview page into whatever groups you specify, one group per table.private StringSpecifies the header text to be placed at the top of each output file.private StringSpecifies the path of an alternate help file path\filename that the HELP link in the top and bottom navigation bars link to.private booleanWhether dependency -sources jars should be resolved and included as source paths for javadoc generation.private booleanDeprecated.if these sources depend on transitive dependencies, those dependencies should be added to the pom as direct dependenciesprivate static final org.codehaus.plexus.languages.java.version.JavaVersionprivate PropertiesUse this parameter only if you want to override the default URLs.static final StringClassifier used in the name of the javadoc-options XML file, and in the resources bundle artifact that gets attached to the project.private FileSpecifies the Javadoc resources directory to be included in the Javadoc (i.e.private StringSets the absolute path of the Javadoc Tool executable to use.private FileDirectory into which assembledJavadocOptionsinstances will be written before they are added to javadoc resources bundles.private org.codehaus.plexus.languages.java.version.JavaVersionVersion of the Javadoc Tool executable to use.private StringVersion of the Javadoc Tool executable to use, ex.Allow for configuration of the javadoc tool via maven toolchains.private booleanAdds HTML meta keyword tags to the generated file for each class.private booleanRun the javadoc tool in pre-Java 9 (non-modular) style even if the java version is post java 9.Creates links to existing javadoc-generated documentation of external referenced classes.private booleanCreates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation.private StringSpecifies the locale that javadoc uses when generating documentation.(package private) final org.codehaus.plexus.languages.java.jpms.LocationManagerprivate org.apache.maven.project.ProjectBuilderProject builderprivate StringSpecifies the maximum Java heap size to be used when launching the Javadoc tool.private StringSpecifies the minimum Java heap size to be used when launching the Javadoc tool.protected org.apache.maven.plugin.MojoExecutionprivate booleanSuppress the entire comment body, including the main description and all tags, generating only declarations.private booleanPrevents the generation of any deprecated API at all in the documentation.private booleanPrevents the generation of the file containing the list of deprecated APIs (deprecated-list.html) and the link in the navigation bar to that page.private booleanOmits the HELP link in the navigation bars at the top and bottom of each page of output.private booleanOmits the index from the generated docs.private booleanOmits the navigation bar from the generated docs.private booleanOmits the entire overview page from the generated docs.private StringOmits qualifying package name from ahead of class names in output.private booleanOmits the "Since" sections from the generated docs.private booleanSuppresses the timestamp, which is hidden in an HTML comment in the generated HTML near the top of each page.private booleanOmits the class/interface hierarchy pages from the generated docs.private booleanSpecify if the Javadoc plugin should operate in offline mode.private OfflineLink[]This option is a variation oflinks; they both create links to javadoc-generated documentation for external referenced classes.private booleanDeprecated.No longer used.protected static final StringTheoptionsfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @filesprotected FileThe shared output directory for the report where Javadoc saves the generated HTML files.protected StringTimestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).private FileSpecifies that javadoc should retrieve the text for the overview documentation from the "source" file specified by path/filename and place it on the Overview page (overview-summary.html).private static final Stringprotected static final StringThepackagesfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @filesprivate StringSpecify the text for upper left frame.List built once from the parameterskippedModulesprotected org.apache.maven.project.MavenProjectThe Maven Project Objectprivate booleanShuts off non-error and non-warning messages, leaving only the warnings and errors appear, making them easier to view.protected List<org.apache.maven.project.MavenProject> The projects in the reactor for aggregation report.private StringProvide source compatibility with specified releaseprivate org.eclipse.aether.RepositorySystemSessionprivate org.eclipse.aether.RepositorySystemprivate ResourceResolverprivate ResourcesArtifact[]A list of artifacts containing resources which should be copied into the Javadoc output directory (like stylesheets, icons, etc.).private booleanGenerates compile-time warnings for missing serial tags.protected org.apache.maven.execution.MavenSessionThe current build session instance.private org.apache.maven.settings.SettingsThe Maven Settings.private StringSpecifies the access level for classes and members to show in the Javadocs.private static final org.codehaus.plexus.languages.java.version.JavaVersionFor Javadoc options appears since Java 8.0.protected org.apache.maven.doxia.tools.SiteToolSiteTool.protected booleanSpecifies whether the Javadoc generation should be skipped.private StringComma separated list of modules (can be regular expression) in the format ([group:]artifactId) to not add in aggregated javadocprivate StringProvide source compatibility with specified release.private FileDirectory where unpacked project sources / test-sources should be cached.exclude filters on the source files.Include filters on the source files.private StringSpecifies the source paths where the subpackages are located.private intSpecify the number of spaces each tab takes up in the source.private booleanSplits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical characters.private FileLocation of the file used to store the state of the previous javadoc run.private StringDeprecated.This is no longer evaluated, instead useaddStylesheetsto customize the CSS.private StringSpecifies the path of an alternate HTML stylesheet file.private StringSpecifies the package directory where javadoc will be executed.private StringSpecifies the class file that starts the taglet used in generating the documentation for that tag.private TagletArtifactSpecifies the Taglet artifact containing the taglet class files (.class).private TagletArtifact[]Specifies several Taglet artifacts containing the taglet class files (.class).private StringSpecifies the search paths for finding taglet class files (.class).private Taglet[]Enables the Javadoc tool to interpret multiple taglets.private Tag[]Enables the Javadoc tool to interpret a simple, one-argument custom block tag tagname in doc comments.static final StringClassifier used in the name of the javadoc-options XML file, and in the resources bundle artifact that gets attached to the project.private org.apache.maven.toolchain.ToolchainManagerprivate StringSpecifies the top text to be placed at the top of each output file.private booleanIncludes one "Use" page for each documented class and package.protected booleanSpecifies to use the options provided by the Standard Doclet for a custom doclet.private booleanFlag controlling content validation ofpackage-list/element-listresources.private booleanProvides more detailed messages while javadoc is running.private booleanIncludes the given version text in the generated docs.private StringSpecifies the title to be placed in the HTML title tag.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsConstructorDescriptionAbstractJavadocMojo(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 Summary
Modifier and TypeMethodDescriptionprivate voidaddAddStyleSheets(List<String> arguments) private voidConvenience method to add an argument to thecommand lineconditionally based on the given flag.private voidaddArgIf(List<String> arguments, boolean b, String value, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion) Convenience method to add an argument to thecommand lineregarding the requested Java version.private voidaddArgIfNotEmpty(List<String> arguments, String key, String value) Convenience method to add an argument to thecommand lineif the value is not null or empty.private voidaddArgIfNotEmpty(List<String> arguments, String key, String value, boolean repeatKey) Convenience method to add an argument to thecommand lineif the value is not null or empty.private voidaddArgIfNotEmpty(List<String> arguments, String key, String value, boolean repeatKey, boolean splitValue) Convenience method to add an argument to thecommand lineif the value is not null or empty.private voidaddArgIfNotEmpty(List<String> arguments, String key, String value, boolean repeatKey, boolean splitValue, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion) Convenience method to add an argument to thecommand lineif the value is not null or empty.private voidaddArgIfNotEmpty(List<String> arguments, String key, String value, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion) Convenience method to add an argument to thecommand lineregarding the requested Java version.private voidaddArgIfNotEmpty(List<String> arguments, String key, String value, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion, boolean repeatKey) Convenience method to add an argument to thecommand lineregarding the requested Java version.private voidaddCommandLineArgFile(org.codehaus.plexus.util.cli.Commandline cmd, File javadocOutputDirectory, List<String> files) Generate a file calledargfile(orfiles, depending on the JDK) to hold files and add the@argfile(or@file, depending on the JDK) in the command line.private voidaddCommandLineOptions(org.codehaus.plexus.util.cli.Commandline cmd, List<String> arguments, File javadocOutputDirectory) Generate anoptionsfile for all options and arguments and add the@optionsin the command line.private voidaddCommandLinePackages(org.codehaus.plexus.util.cli.Commandline cmd, File javadocOutputDirectory, Collection<String> packageNames) Generate a file calledpackagesto hold all package names and add the@packagesin the command line.private voidAddgroupsparameter to arguments.private voidaddJavadocOptions(File javadocOutputDirectory, List<String> arguments, Collection<JavadocModule> allSourcePaths, Set<OfflineLink> offlineLinks) Add Standard Javadoc Options.private voidaddLinkArguments(List<String> arguments) Convenience method to processlinksvalues as individual-linkjavadoc options.private voidaddLinkofflineArguments(List<String> arguments, Set<OfflineLink> offlineLinksList) Convenience method to processofflineLinksvalues as individual-linkofflinejavadoc options.private voidaddMemoryArg(org.codehaus.plexus.util.cli.Commandline cmd, String arg, String memory) Method that adds/sets the java memory parameters in the command line execution.private voidaddProxyArg(org.codehaus.plexus.util.cli.Commandline cmd) Method that adds/sets the javadoc proxy parameters in the command line execution.private voidaddStandardDocletOptions(File javadocOutputDirectory, List<String> arguments, Set<OfflineLink> offlineLinks) Add Standard Doclet Options.private voidaddTaglets(List<String> arguments) Addtagletsparameter to arguments.private voidaddTagletsFromTagletArtifacts(List<String> arguments) Auto-detect taglets class name fromtagletArtifactsand add them to arguments.private voidAddtagsparameter to arguments.private JavadocModulebuildJavadocModule(org.apache.maven.project.MavenProject project, Collection<Path> sourcePaths) protected final JavadocOptionsGenerate 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 booleancanGenerateReport(Map<Path, Collection<String>> files) Method that indicates whether the javadoc can be generated or not.private static Stringprivate Set<BootclasspathArtifact> private Set<DocletArtifact> private Set<OfflineLink> private Set<ResourcesArtifact> private Set<TagletArtifact> protected SourceResolverConfigOverride this method to customize the configuration for resolving dependency sources.private booleancontainsWarnings(String output) private voidcopyAdditionalJavadocResources(File anOutputDirectory) Method that copy additional Javadoc resources from given artifacts.private voidcopyAllResources(File javadocOutputDirectory) Copy all resources to the output directory.private voidcopyJavadocResources(File anOutputDirectory) Method that copy alldoc-filesdirectories fromjavadocDirectoryof the current project or of the projects in the reactor to theoutputDirectory.private org.apache.maven.artifact.ArtifactcreateAndResolveArtifact(JavadocPathArtifact javadocArtifact) Creates anArtifactrepresenting the configuredJavadocPathArtifactand resolves it.private org.apache.maven.shared.artifact.filter.resolve.TransformableFilterReturns an ArtifactFilter that only includes direct dependencies of this project (verified via groupId and artifactId).protected abstract voidprivate voiddoExecuteJavadocCommandLine(org.codehaus.plexus.util.cli.Commandline cmd, File javadocOutputDirectory) Execute the Javadoc command linevoidexecute()private voidexecuteJavadocCommandLine(org.codehaus.plexus.util.cli.Commandline cmd, File javadocOutputDirectory) Execute the Javadoc command lineprotected voidexecuteReport(Locale unusedLocale) The package documentation details the Javadoc Options used by this Plugin.protected voidfailOnError(String prefix, Exception e) private PathfindMainDescriptor(Collection<Path> roots) followLinks(Set<String> links) Follows the given links if the Javadoc version is before 12, and returns their last redirect locations.private StringMethod to get the access level for the classes and members to be shown in the generated javadoc.getAddStylesheet(File javadocOutputDirectory, String stylesheet) private List<org.apache.maven.project.MavenProject> getArtifactsAbsolutePath(JavadocPathArtifact javadocArtifact) Return the Javadoc artifact path and its transitive dependencies path from the local repositoryprotected StringOverride this if you need to provide a bundle attachment classifier, as in the case of test javadocs.private StringMethod to get the path of the bootclass artifacts used in the-bootclasspathoption.private StringMethod that sets the text that will be displayed on the bottom of the javadocs.private Stringprotected FilegetClassesFile(org.apache.maven.project.MavenProject project) protected final OfflineLinkUsing Maven, a Javadoc link is given by${project.url}/apidocs.protected org.eclipse.aether.util.filter.ScopeDependencyFilterprotected final Collection<JavadocModule> Resolve dependency sources so they can be included directly in the javadoc process.private SourceResolverConfigConstruct a SourceResolverConfig for resolving dependency sources and resources in a consistent way, so it can be reused for both source and resource resolution.private Stringprivate StringMethod to get the path of the doclet artifacts used in the-docletpathoption.protected Stringprotected Stringprivate Stringprivate Collection<String> Method to get the packages specified in theexcludePackageNamesparameter.private StringgetExcludedPackages(Collection<Path> sourcePaths) Method to get the excluded source files from the javadoc and create the argument string that will be included in the javadoc commandline execution.getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p) protected Map<Path, Collection<String>> getFiles(Collection<Path> sourcePaths) Method to get the files on the specified source pathsgetFilesWithUnnamedPackages(Map<Path, Collection<String>> sourcePaths) private StringGet the full javadoc goal.getHelpFile(File javadocOutputDirectory) Method to get the help file to be used by the Javadoc Tool.protected Fileprivate StringGet the path of the Javadoc tool executable depending on the user entry or try to find it depending on the OS or thejava.homesystem property or theJAVA_HOMEenvironment variable.private static StringgetJavadocLink(org.apache.maven.project.MavenProject project) protected final FileConstruct the output file for the generated javadoc-options XML file, after creating the javadocOptionsDir if necessary.private List<OfflineLink> Using Maven, a Javadoc link is given by${project.url}/apidocs.getModuleSourcePathFiles(Map<Path, Collection<String>> sourcePaths) private Set<OfflineLink> protected Stringprotected FilegetPackageNames(Map<Path, Collection<String>> sourcePaths) private Collection<String> getPackageNamesRespectingJavaModules(Collection<JavadocModule> javadocModules) private Collection<File> Method that gets the classpath and modulepath elements that will be specified in the javadoc-classpathand--module-pathparameter.private static org.apache.maven.model.Pluginprivate static StringgetPluginParameter(org.apache.maven.project.MavenProject project, String pluginId, String param) protected StringMethod that returns the plugin report output directory where the generated Javadoc report will be put beneathgetOutputDirectory()/AbstractMavenReport.getReportOutputDirectory().protected org.apache.maven.project.MavenProjectprivate org.apache.maven.project.ProjectBuildingRequestgetProjectBuildingRequest(org.apache.maven.project.MavenProject currentProject) getProjectBuildOutputDirs(org.apache.maven.project.MavenProject p) getProjectSourceRoots(org.apache.maven.project.MavenProject p) protected List<org.apache.maven.project.MavenProject> private org.codehaus.plexus.languages.java.jpms.ResolvePathResultgetResolvePathResult(File artifactFile) getResource(File outputFile, String inputResourceName) private URLgetResource(List<String> classPath, String resource) private StringgetSourcePath(Collection<Path> sourcePaths) Method to format the specified source paths that will be accepted by the javadoc tool.protected Collection<JavadocModule> Method to get the source paths per reactorProject.getSpecialFiles(Map<Path, Collection<String>> sourcePaths) Either return only the module descriptor or all sourcefiles per sourcepathgetStylesheetFile(File javadocOutputDirectory) Method to get the stylesheet path file to be used by the Javadoc Tool.private StringMethod to get the path of the taglet artifacts used in the-tagletpathoption.protected final org.apache.maven.toolchain.Toolchainprotected Stringprotected booleanIndicates whether this goal is flagged with@aggregator.protected booleanprivate booleanisDocletArtifactEmpty(DocletArtifact aDocletArtifact) Verify if a doclet artifact is empty or notprivate booleanDetermines whether the specified string is informational output of the Javadoc tool.
Such output should not be included as exception message or logged as warning or error.private booleanisJavaDocVersionAtLeast(org.codehaus.plexus.languages.java.version.JavaVersion requiredVersion) Is the Javadoc version at least the requested version.private booleanisJavadocVMInitError(String output) Check if the Javadoc JVM is correctly started or not.protected booleanisSkippedJavadoc(org.apache.maven.project.MavenProject mavenProject) protected booleanisSkippedModule(org.apache.maven.project.MavenProject mavenProject) protected booleanisTest()Indicates whether this goal generates documentation for theJava Test code.private booleanisUpToDate(org.codehaus.plexus.util.cli.Commandline cmd) Check if the javadoc is uptodate or notprotected booleanisValidJavadocLink(String link, boolean detecting) protected voidLogs an error with throwable content only if in debug.private booleanmatches(DependencyLink d, org.apache.maven.artifact.Artifact artifact) private Set<org.apache.maven.project.MavenProject> modulesForAggregatedProject(org.apache.maven.project.MavenProject aggregatedProject, Map<Path, org.apache.maven.project.MavenProject> reactorProjectsMap) Recursively add the modules of the aggregatedProject to the set of aggregatedModules.private voidpopulateCompileArtifactMap(Map<String, org.apache.maven.artifact.Artifact> compileArtifactMap, Collection<org.apache.maven.artifact.Artifact> artifactList) Method to put the artifacts in the hashmap.org.apache.maven.artifact.ArtifactresolveDependency(org.apache.maven.model.Dependency dependency) private voidprivate voidsetFJavadocVersion(File jExecutable) Set a new value forjavadocRuntimeVersionprivate List<org.eclipse.aether.graph.Dependency> toResolverDependencies(List<org.apache.maven.model.Dependency> dependencies) trimValues(List<String> items) private voidChecks for the validity of the Javadoc options used by the user.private voidChecks for the validity of the Standard Doclet options.protected final voidverifyRemovedParameter(String paramName) private voidverifyReplacedParameter(String oldParamName, String newParamNew) private voidwriteDebugJavadocScript(String cmdLine, File javadocOutputDirectory) Write a debug javadoc script in case of command line error or in debug mode.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
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. This one is used for non-test javadocs.- Since:
- 2.7
- See Also:
-
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. This one is used for test-javadocs.- Since:
- 2.7
- See Also:
-
DEBUG_JAVADOC_SCRIPT_NAME
The Javadoc script file name whendebugparameter is on, i.e. javadoc.bat or javadoc.sh -
OPTIONS_FILE_NAME
Theoptionsfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @files- See Also:
-
PACKAGES_FILE_NAME
Thepackagesfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @files- See Also:
-
ARGFILE_FILE_NAME
Theargfilefile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @files- See Also:
-
FILES_FILE_NAME
Thefilesfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @files- See Also:
-
DEFAULT_CSS_NAME
Default CSS file name, used as file name in the output directory for the temporary custom stylesheet file loaded from classloader resources.- See Also:
-
PACKAGE_LIST
- See Also:
-
ELEMENT_LIST
- See Also:
-
SINCE_JAVADOC_1_8
private static final org.codehaus.plexus.languages.java.version.JavaVersion SINCE_JAVADOC_1_8For Javadoc options appears since Java 8.0. See Javadoc Technology- Since:
- 3.0.0
-
JAVA_VERSION
private static final org.codehaus.plexus.languages.java.version.JavaVersion JAVA_VERSION -
siteTool
protected org.apache.maven.doxia.tools.SiteTool siteToolSiteTool. -
archiverManager
private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManagerArchiver manager- Since:
- 2.5
-
resourceResolver
-
repoSystem
private org.eclipse.aether.RepositorySystem repoSystem -
repoSession
@Parameter(defaultValue="${repositorySystemSession}", readonly=true, required=true) private org.eclipse.aether.RepositorySystemSession repoSession -
artifactHandlerManager
private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager -
mavenProjectBuilder
private org.apache.maven.project.ProjectBuilder mavenProjectBuilderProject builder- Since:
- 3.0
-
toolchainManager
private org.apache.maven.toolchain.ToolchainManager toolchainManager -
locationManager
final org.codehaus.plexus.languages.java.jpms.LocationManager locationManager -
session
@Parameter(defaultValue="${session}", readonly=true, required=true) protected org.apache.maven.execution.MavenSession sessionThe current build session instance. This is used for toolchain manager API calls. -
settings
@Parameter(defaultValue="${settings}", readonly=true, required=true) private org.apache.maven.settings.Settings settingsThe Maven Settings.- Since:
- 2.3
-
project
@Parameter(defaultValue="${project}", readonly=true, required=true) protected org.apache.maven.project.MavenProject projectThe Maven Project Object -
mojoExecution
@Parameter(defaultValue="${mojoExecution}", readonly=true, required=true) protected org.apache.maven.plugin.MojoExecution mojoExecution -
offline
@Parameter(property="maven.javadoc.offline", defaultValue="false") private boolean offlineSpecify if the Javadoc plugin should operate in offline mode. If maven is run in offline mode (using-oor--offlineon the command line), this option has no effect and the plugin is always in offline mode.- Since:
- 3.6.0
-
javadocDirectory
Specifies the Javadoc resources directory to be included in the Javadoc (i.e. package.html, images...).
Could be used in addition ofdocfilessubdirsparameter.
See docfilessubdirs.- Since:
- 2.1
- See Also:
-
additionalOptions
Set an additional option(s) on the command line. All input will be passed as-is to the@optionsfile. You must take care of quoting and escaping. Useful for a custom doclet.- Since:
- 3.0.0
-
additionalJOption
Sets additional Javadoc options (e.g. JVM options) on the command line. Example:<additionalJOption>-J-Xss128m</additionalJOption>
- Since:
- 2.3
- See Also:
-
additionalJOptions
Sets additional Javadoc options for the execution of the javadoc command via the '-J' option to javadoc. Example:<additionalJOptions> <additionalJOption>-J-Xmx1g </additionalJOption> </additionalJOptions>- Since:
- 2.9
- See Also:
-
resourcesArtifacts
A list of artifacts containing resources which should be copied into the Javadoc output directory (like stylesheets, icons, etc.).
Example:<resourcesArtifacts> <resourcesArtifact> <groupId>external.group.id</groupId> <artifactId>external-resources</artifactId> <version>1.0</version> </resourcesArtifact> </resourcesArtifacts>
See Javadoc.- Since:
- 2.5
-
reactorProjects
@Parameter(defaultValue="${reactorProjects}", required=true, readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjectsThe projects in the reactor for aggregation report. -
debug
@Parameter(property="debug", defaultValue="false") private boolean debugSet this totrueto debug the Javadoc plugin. With this,javadoc.bat(or.sh),options,@packagesorargfilefiles are provided in the output directory.- Since:
- 2.1
-
javadocExecutable
Sets the absolute path of the Javadoc Tool executable to use. Since version 2.5, a mere directory specification is sufficient to have the plugin use "javadoc" or "javadoc.exe" respectively from this directory.- Since:
- 2.3
-
javadocVersion
Version of the Javadoc Tool executable to use, ex. "1.3", "1.5".- Since:
- 2.3
-
javadocRuntimeVersion
private org.codehaus.plexus.languages.java.version.JavaVersion javadocRuntimeVersionVersion of the Javadoc Tool executable to use. -
skip
@Parameter(property="maven.javadoc.skip", defaultValue="false") protected boolean skipSpecifies whether the Javadoc generation should be skipped.- Since:
- 2.5
-
failOnError
@Parameter(property="maven.javadoc.failOnError", defaultValue="true") protected boolean failOnErrorSpecifies if the build will fail if there are errors during javadoc execution or not.- Since:
- 2.5
-
failOnWarnings
@Parameter(property="maven.javadoc.failOnWarnings", defaultValue="false") protected boolean failOnWarningsSpecifies if the build will fail if there are warning during javadoc execution or not.- Since:
- 3.0.1
-
useStandardDocletOptions
@Parameter(property="useStandardDocletOptions", defaultValue="true") protected boolean useStandardDocletOptionsSpecifies 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
-
detectLinks
@Parameter(property="detectLinks", defaultValue="false") private boolean detectLinksDetect the Javadoc links for all dependencies defined in the project. The detection is based on the default Maven conventions, i.e.:${project.url}/apidocs.
For instance, if the project has a dependency to Apache Commons Lang i.e.:<dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> </dependency>
The added Javadoc-linkparameter will behttp://commons.apache.org/lang/apidocs.- Since:
- 2.6
- See Also:
-
detectOfflineLinks
@Parameter(property="detectOfflineLinks", defaultValue="true") private boolean detectOfflineLinksDetect the links for all modules defined in the project.
IfreactorProjectsis defined in a non-aggregator way, it generates default offline links between modules based on the defined project's URLs. For instance, if a parent project has two projectsmodule1andmodule2, the-linkofflinewill be:
The added Javadoc-linkofflineparameter for module1 will be/absolute/path/to/module2/target/site/apidocs
The added Javadoc-linkofflineparameter for module2 will be/absolute/path/to/module1/target/site/apidocs- Since:
- 2.6
- See Also:
-
detectJavaApiLink
@Parameter(property="detectJavaApiLink", defaultValue="true") private boolean detectJavaApiLinkDetect the Java API link for the current build, e.g.https://docs.oracle.com/javase/1.4.2/docs/api/for Java source 1.4.
By default, the goal detects the Javadoc API link depending on the value of thesourceparameter in theorg.apache.maven.plugins:maven-compiler-plugin(defined in${project.build.plugins}or in${project.build.pluginManagement}), or try to compute it from thejavadocExecutableversion.- Since:
- 2.6
- See Also:
-
javaApiLinks
Use this parameter only if you want to override the default URLs. The key should matchapi_x, wherexmatches the Java version. For example:- api_1.5
- https://docs.oracle.com/javase/1.5.0/docs/api/
- api_1.8
- https://docs.oracle.com/javase/8/docs/api/
- api_9
- https://docs.oracle.com/javase/9/docs/api/
- Since:
- 2.6
-
validateLinks
@Parameter(property="validateLinks", defaultValue="false") private boolean validateLinksFlag controlling content validation ofpackage-list/element-listresources. If set, the content ofpackage-list/element-listresources will be validated.- Since:
- 2.8
-
bootclasspath
Specifies the paths where the boot classes reside. Thebootclasspathcan contain multiple paths by separating them with a colon (:) or a semicolon (;).- Since:
- 2.5
- See Also:
-
bootclasspathArtifacts
@Parameter(property="bootclasspathArtifacts") private BootclasspathArtifact[] bootclasspathArtifactsSpecifies the artifacts where the boot classes reside.
Example:<bootclasspathArtifacts> <bootclasspathArtifact> <groupId>my-groupId</groupId> <artifactId>my-artifactId</artifactId> <version>my-version</version> </bootclasspathArtifact> </bootclasspathArtifacts>
See Javadoc.- Since:
- 2.5
- See Also:
-
breakiterator
@Parameter(property="breakiterator", defaultValue="false") private boolean breakiteratorUses the sentence break iterator to determine the end of the first sentence.- See Also:
-
doclet
Specifies the class file that starts the doclet used in generating the documentation.- See Also:
-
docletArtifact
-
docletArtifacts
Specifies multiple artifacts containing the path for the doclet starting class file (specified with thedocletoption).
Example:<docletArtifacts> <docletArtifact> <groupId>com.sun.tools.doclets</groupId> <artifactId>doccheck</artifactId> <version>1.2b2</version> </docletArtifact> </docletArtifacts>
See Javadoc.- Since:
- 2.1
- See Also:
-
docletPath
-
encoding
@Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") private String encodingSpecifies the encoding name of the source files. If not specified, the encoding value will be the value of thefile.encodingsystem property.
Note: In 2.4, the default value was locked toISO-8859-1to ensure reproducing build, but this was reverted in 2.5.- See Also:
-
excludePackageNames
Unconditionally excludes the specified packages and their subpackages from the list formed by-subpackages. Multiple packages can be separated by commas (,), colons (:) or semicolons (;).Wildcards work as followed:
- a wildcard at the beginning should match one or more directories
- any other wildcard must match exactly one directory
<excludePackageNames>*.internal:org.acme.exclude1.*:org.acme.exclude2</excludePackageNames>
- See Also:
-
extdirs
Specifies the directories where extension classes reside. Separate directories inextdirswith a colon (:) or a semicolon (;).- See Also:
-
locale
Specifies the locale that javadoc uses when generating documentation.- See Also:
-
maxmemory
Specifies the maximum Java heap size to be used when launching the Javadoc tool. JVMs refer to this property as the-Xmxparameter. Example: '512' or '512m'. The memory unit depends on the JVM used. The units supported could be:k,kb,m,mb,g,gb,t,tb. If no unit specified, the default unit ism. -
minmemory
Specifies the minimum Java heap size to be used when launching the Javadoc tool. JVMs refer to this property as the-Xmsparameter. Example: '512' or '512m'. The memory unit depends on the JVM used. The units supported could be:k,kb,m,mb,g,gb,t,tb. If no unit specified, the default unit ism. -
old
Deprecated.No longer used.This option creates documentation with the appearance and functionality of documentation generated by Javadoc 1.1. This is no longer supported since Javadoc 1.4 (shipped with JDK 1.4)- See Also:
-
overview
@Parameter(property="overview", defaultValue="${basedir}/src/main/javadoc/overview.html") private File overviewSpecifies that javadoc should retrieve the text for the 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 withnooverview.- See Also:
-
quiet
@Parameter(property="quiet", defaultValue="false") private boolean quietShuts off non-error and non-warning messages, leaving only the warnings and errors appear, making them easier to view.
Note: was a standard doclet in Java 1.4.2 (refer to bug ID 4714350).
Since Java 5.0.- See Also:
-
show
Specifies the access level for classes and members to show in the Javadocs. Possible values are:- public (shows only public classes and members)
- protected (shows only public and protected classes and members)
- package (shows all classes and members not marked private)
- private (shows all classes and members)
- See Also:
-
source
-
release
Provide source compatibility with specified release- Since:
- JDK 9, 3.1.0
- See Also:
-
sourcepath
Specifies the source paths where the subpackages are located. Thesourcepathcan contain multiple paths by separating them with a colon (:) or a semicolon (;).- See Also:
-
disableSourcepathUsage
@Parameter(property="maven.javadoc.disableSourcepathUsage") private boolean disableSourcepathUsageWhen using legacyMode and aggregated javadoc, users may have a mix of Maven modules with module files and not. The javadoc need to be called with empty-sourcepathargument and files are in the argfile This usually need to be used with the following configuration<sourceFileExcludes> <sourceFileExclude>**\/module-info.java</sourceFileExclude> </sourceFileExcludes>- Since:
- 3.11.2
-
subpackages
Specifies the package directory where javadoc will be executed. Multiple packages can be separated by colons (:).- See Also:
-
verbose
@Parameter(property="verbose", defaultValue="false") private boolean verboseProvides more detailed messages while javadoc is running.- See Also:
-
legacyMode
@Parameter(property="legacyMode", defaultValue="false") private boolean legacyModeRun the javadoc tool in pre-Java 9 (non-modular) style even if the java version is post java 9. This allows non-JPMS projects that have moved to newer Java versions to create javadocs without having to use JPMS modules.- Since:
- 3.6.0
-
author
@Parameter(property="author", defaultValue="true") private boolean authorSpecifies whether the author text is included in the generated Javadocs.- See Also:
-
bottom
@Parameter(property="bottom", defaultValue="Copyright © {inceptionYear}–{currentYear} {organizationName}. All rights reserved.") private String bottomSpecifies the text to be placed at the bottom of each output file.
If you want to use html, you have to put it in a CDATA section,
e.g.<![CDATA[Copyright 2005, <a href="http://www.mycompany.com">MyCompany, Inc.<a>]]>
Note:If the project has the propertyproject.build.outputTimestamp, its year will be used as {currentYear}. This way it is possible to generate reproducible javadoc jars.- See Also:
-
charset
Specifies the HTML character set for this document. If not specified, the charset value will be the value of thedocencodingparameter.- See Also:
-
docencoding
@Parameter(property="docencoding", defaultValue="${project.reporting.outputEncoding}") private String docencodingSpecifies the encoding of the generated HTML files. If not specified, the docencoding value will beUTF-8.- See Also:
-
docfilessubdirs
@Parameter(property="docfilessubdirs", defaultValue="false") private boolean docfilessubdirsEnables deep copying of the**/doc-filesdirectories and the specificresourcesdirectory from thejavadocDirectorydirectory (for instance,src/main/javadoc/com/mycompany/myapp/doc-filesandsrc/main/javadoc/resources).- See Also:
-
doclint
Specifies specific checks to be performed on Javadoc comments.- Since:
- 3.0.0
- See Also:
-
doctitle
@Parameter(property="doctitle", defaultValue="${project.name} ${project.version} API") private String doctitleSpecifies the title to be placed near the top of the overview summary file.- See Also:
-
excludedocfilessubdir
Excludes any "doc-files" subdirectories with the given names. Multiple patterns can be excluded by separating them with colons (:).- See Also:
-
groups
Separates packages on the overview page into whatever groups you specify, one group per table. The packages pattern can be any package name, or can be the start of any package name followed by an asterisk (*) meaning "match any characters". Multiple patterns can be included in a group by separating them with colons (:).
Example:<groups> <group> <title>Core Packages</title> <!-- To includes java.lang, java.lang.ref, java.lang.reflect and only java.util (i.e. not java.util.jar) --> <packages>java.lang*:java.util</packages> </group> <group> <title>Extension Packages</title> <!-- To include javax.accessibility, javax.crypto, ... (among others) --> <packages>javax.*</packages> </group> </groups>Note: usingjava.lang.*forpackageswould omit thejava.langpackage but usingjava.lang*will include it.- See Also:
-
header
Specifies the header text to be placed at the top of each output file.- See Also:
-
helpfile
Specifies the path of an alternate help file path\filename that the HELP link in the top and bottom navigation bars link to.
Note: could be in conflict with <nohelp/>.
Thehelpfilecould be an absolute File path.
Since 2.6, it could be also be a path from a resource in the current project source directories (i.e.src/main/java,src/main/resourcesorsrc/main/javadoc) or from a resource in the Javadoc plugin dependencies, for instance:<helpfile>path/to/your/resource/yourhelp-doc.html</helpfile>
Wherepath/to/your/resource/yourhelp-doc.htmlcould be insrc/main/javadoc.<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <helpfile>path/to/your/resource/yourhelp-doc.html</helpfile> ... </configuration> <dependencies> <dependency> <groupId>groupId</groupId> <artifactId>artifactId</artifactId> <version>version</version> </dependency> </dependencies> </plugin> ... <plugins> </build>Wherepath/to/your/resource/yourhelp-doc.htmlis defined in thegroupId:artifactId:versionjavadoc plugin dependency.- See Also:
-
keywords
@Parameter(property="keywords", defaultValue="false") private boolean keywordsAdds HTML meta keyword tags to the generated file for each class.- Since:
- 2.1
- See Also:
-
links
Creates links to existing javadoc-generated documentation of external referenced classes.Notes:
- This option is ignored if the plugin is run in offline mode using the
<offline>setting or by specifying-o, --offlineor-Dmaven.javadoc.offline=trueon the command line. - All given links should have a fetchable
/package-listor/element-list(since Java 10). For instance:<links> <link>https://docs.oracle.com/en/java/javase/17/docs/api</link> </links>
will be used becausehttps://docs.oracle.com/en/java/javase/17/docs/api/element-listexists. - If
detectLinksis defined, the links between the project dependencies are automatically added. - If
detectJavaApiLinkis defined, a Java API link, based on the Java version of the project's sources, will be added automatically.
- See Also:
- This option is ignored if the plugin is run in offline mode using the
-
dependencyLinks
Redefine the apidoc URL for specific dependencies when usingdetectLinks. Useful if the dependency wasn't build with Maven or when the apidocs have been moved.<dependencyLinks> <dependencyLink> <groupId>groupId</groupId> <artifactId>artifactId</artifactId> <classifier>classifier</classifier> <!-- optional --> <url>version</url> </dependencyLink> </dependencyLinks>- Since:
- 3.3.0
- See Also:
-
linksource
@Parameter(property="linksource", defaultValue="false") private boolean linksourceCreates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation.- See Also:
-
nocomment
@Parameter(property="nocomment", defaultValue="false") private boolean nocommentSuppress the entire comment body, including the main description and all tags, generating only declarations.- See Also:
-
nodeprecated
@Parameter(property="nodeprecated", defaultValue="false") private boolean nodeprecatedPrevents the generation of any deprecated API at all in the documentation.- See Also:
-
nodeprecatedlist
@Parameter(property="nodeprecatedlist", defaultValue="false") private boolean nodeprecatedlistPrevents the generation of the file containing the list of deprecated APIs (deprecated-list.html) and the link in the navigation bar to that page.- See Also:
-
nohelp
@Parameter(property="nohelp", defaultValue="false") private boolean nohelpOmits the HELP link in the navigation bars at the top and bottom of each page of output.
Note: could be in conflict withhelpfile.- See Also:
-
noindex
@Parameter(property="noindex", defaultValue="false") private boolean noindexOmits the index from the generated docs.
Note: could be in conflict withsplitindex- See Also:
-
nooverview
@Parameter(property="nooverview", defaultValue="false") private boolean nooverviewOmits the entire overview page from the generated docs.
Note: could be in conflict withoverview.
Standard Doclet undocumented option.- Since:
- 2.4
-
noqualifier
Omits qualifying package name from ahead of class names in output. Example:<noqualifier>all</noqualifier> or <noqualifier>packagename1:packagename2</noqualifier>
- See Also:
-
nosince
@Parameter(property="nosince", defaultValue="false") private boolean nosinceOmits the "Since" sections from the generated docs.- See Also:
-
notimestamp
@Parameter(property="notimestamp", defaultValue="false") private boolean notimestampSuppresses the timestamp, which is hidden in an HTML comment in the generated HTML near the top of each page.
Note: If the project has the propertyproject.build.outputTimestamp, the value will be overwritten to true. This way it is possible to generate reproducible javadoc jars.- Since:
- 2.1
- See Also:
-
notree
@Parameter(property="notree", defaultValue="false") private boolean notreeOmits the class/interface hierarchy pages from the generated docs.- See Also:
-
offlineLinks
This option is a variation oflinks; they both create links to javadoc-generated documentation for external referenced classes.
Example:<offlineLinks> <offlineLink> <url>https://docs.oracle.com/javase/1.5.0/docs/api/</url> <location>../javadoc/jdk-5.0/</location> </offlineLink> </offlineLinks>
Note: ifdetectOfflineLinksis defined, the offline links between the project modules are automatically added if the goal is calling in a non-aggregator way.- See Also:
-
outputDirectory
@Parameter(defaultValue="${project.build.directory}/reports", required=true) protected File outputDirectoryThe shared output directory for the report where Javadoc saves the generated HTML files. Note that this parameter is only evaluated if the goal is run directly from the command line. If the goal is run indirectly as part of a site generation, the shared output directory configured in the Maven Site Plugin is used instead.- See Also:
-
packagesheader
Specify the text for upper left frame.- Since:
- 2.1
- See Also:
-
serialwarn
@Parameter(property="serialwarn", defaultValue="false") private boolean serialwarnGenerates compile-time warnings for missing serial tags.- See Also:
-
sourcetab
@Parameter(property="sourcetab", alias="linksourcetab") private int sourcetabSpecify the number of spaces each tab takes up in the source. If no tab is used in source, the default space is used.- Since:
- 2.1
- See Also:
-
splitindex
@Parameter(property="splitindex", defaultValue="false") private boolean splitindexSplits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical characters.
Note: could be in conflict withnoindex.- See Also:
-
stylesheet
Deprecated.This is no longer evaluated, instead useaddStylesheetsto customize the CSS.Specifies whether the stylesheet to be used is themaven's javadoc stylesheet orjava's default stylesheet when astylesheetfileparameter is not specified.
Possible values:mavenorjava. -
stylesheetfile
Specifies the path of an alternate HTML stylesheet file.
Thestylesheetfilecould be an absolute File path.
Since 2.6, it could be also be a path from a resource in the current project source directories (i.e.src/main/java,src/main/resourcesorsrc/main/javadoc) or from a resource in the Javadoc plugin dependencies, for instance:<stylesheetfile>path/to/your/resource/yourstylesheet.css</stylesheetfile>
Wherepath/to/your/resource/yourstylesheet.csscould be insrc/main/javadoc.<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <stylesheetfile>path/to/your/resource/yourstylesheet.css</stylesheetfile> ... </configuration> <dependencies> <dependency> <groupId>groupId</groupId> <artifactId>artifactId</artifactId> <version>version</version> </dependency> </dependencies> </plugin> ... <plugins> </build>Wherepath/to/your/resource/yourstylesheet.cssis defined in thegroupId:artifactId:versionjavadoc plugin dependency.- See Also:
-
addStylesheets
Specifies the path of an additional HTML stylesheet file relative to thejavadocDirectoryExample:<addStylesheets> <addStylesheet>resources/addstylesheet.css</addStylesheet> </addStylesheets>- Since:
- 3.3.0
-
taglet
Specifies the class file that starts the taglet used in generating the documentation for that tag.- See Also:
-
tagletArtifact
Specifies the Taglet artifact containing the taglet class files (.class).
Example:<taglets> <taglet> <tagletClass>com.sun.tools.doclets.ToDoTaglet</tagletClass> </taglet> <taglet> <tagletClass>package.to.AnotherTagletClass</tagletClass> </taglet> ... </taglets> <tagletArtifact> <groupId>group-Taglet</groupId> <artifactId>artifact-Taglet</artifactId> <version>version-Taglet</version> </tagletArtifact>
See Javadoc.- Since:
- 2.1
- See Also:
-
tagletArtifacts
Specifies several Taglet artifacts containing the taglet class files (.class). These taglet class names will be auto-detected and so no need to specify them.
Example:<tagletArtifacts> <tagletArtifact> <groupId>group-Taglet</groupId> <artifactId>artifact-Taglet</artifactId> <version>version-Taglet</version> </tagletArtifact> ... </tagletArtifacts>
See Javadoc.- Since:
- 2.5
- See Also:
-
tagletpath
Specifies the search paths for finding taglet class files (.class). Thetagletpathcan contain multiple paths by separating them with a colon (:) or a semicolon (;).- See Also:
-
taglets
Enables the Javadoc tool to interpret multiple taglets.
Example:<taglets> <taglet> <tagletClass>com.sun.tools.doclets.ToDoTaglet</tagletClass> <!--<tagletpath>/home/taglets</tagletpath>--> <tagletArtifact> <groupId>group-Taglet</groupId> <artifactId>artifact-Taglet</artifactId> <version>version-Taglet</version> </tagletArtifact> </taglet> </taglets>
See Javadoc.- Since:
- 2.1
- See Also:
-
tags
Enables the Javadoc tool to interpret a simple, one-argument custom block tag tagname in doc comments.
Example:<tags> <tag> <name>todo</name> <placement>a</placement> <head>To Do:</head> </tag> </tags>Note: the placement should be a combinaison of Xaoptcmf letters:X(disable tag)a(all)o(overview)p(packages)t(types, that is classes and interfaces)c(constructors)m(methods)f(fields)
- See Also:
-
top
Specifies the top text to be placed at the top of each output file.- Since:
- 2.4
- See Also:
-
use
@Parameter(property="use", defaultValue="true") private boolean useIncludes one "Use" page for each documented class and package.- See Also:
-
version
@Parameter(property="version", defaultValue="true") private boolean versionIncludes the given version text in the generated docs.- See Also:
-
windowtitle
@Parameter(property="windowtitle", defaultValue="${project.name} ${project.version} API") private String windowtitleSpecifies the title to be placed in the HTML title tag.- See Also:
-
includeDependencySources
@Parameter(defaultValue="false") private boolean includeDependencySourcesWhether dependency -sources jars should be resolved and included as source paths for javadoc generation. This is useful when creating javadocs for a distribution project.- Since:
- 2.7
-
sourceDependencyCacheDir
@Parameter(defaultValue="${project.build.directory}/distro-javadoc-sources") private File sourceDependencyCacheDirDirectory where unpacked project sources / test-sources should be cached.- Since:
- 2.7
- See Also:
-
includeTransitiveDependencySources
Deprecated.if these sources depend on transitive dependencies, those dependencies should be added to the pom as direct dependenciesWhether to include transitive dependencies in the list of dependency -sources jars to include in this javadoc run.- Since:
- 2.7
- See Also:
-
dependencySourceIncludes
-
dependencySourceExcludes
-
javadocOptionsDir
@Parameter(defaultValue="${project.build.directory}/javadoc-bundle-options", readonly=true) private File javadocOptionsDirDirectory into which assembledJavadocOptionsinstances will be written before they are added to javadoc resources bundles.- Since:
- 2.7
-
dependencyJavadocBundles
Transient variable to allow lazy-resolution of javadoc bundles from dependencies, so they can be used at various points in the javadoc generation process.- Since:
- 2.7
-
additionalDependencies
Capability to add additional dependencies to the javadoc classpath. Example:<additionalDependencies> <additionalDependency> <groupId>geronimo-spec</groupId> <artifactId>geronimo-spec-jta</artifactId> <version>1.0.1B-rc4</version> </additionalDependency> </additionalDependencies>- Since:
- 2.8.1
-
sourceFileIncludes
-
sourceFileExcludes
-
applyJavadocSecurityFix
@Deprecated @Parameter(defaultValue="true", property="maven.javadoc.applyJavadocSecurityFix") private boolean applyJavadocSecurityFixDeprecated.the security fix this applied is not needed in Java 8+ or the most recent versions of JDK 6 and 7.No-op.- Since:
- 2.9.1
-
jdkToolchain
Allow for configuration of the javadoc tool via maven toolchains. This overrules the toolchain selected by the maven-toolchain-plugin.
Examples:
(see Guide to Toolchains for more info)
note: requires at least Maven 3.3.1<configuration> ... <jdkToolchain> <version>11</version> </jdkToolchain> </configuration> <configuration> ... <jdkToolchain> <version>1.8</version> <vendor>zulu</vendor> </jdkToolchain> </configuration>- Since:
- 3.0.0
-
staleDataPath
@Parameter(property="staleDataPath", defaultValue="${project.build.directory}/maven-javadoc-plugin-stale-data.txt") private File staleDataPathLocation of the file used to store the state of the previous javadoc run. This is used to skip the generation if nothing has changed.
- Since:
- 3.2.0
-
skippedModules
Comma separated list of modules (can be regular expression) in the format ([group:]artifactId) to not add in aggregated javadoc
- Since:
- 3.2.0
-
patternsToSkip
List built once from the parameterskippedModules -
outputTimestamp
Timestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).- Since:
- 3.2.0
-
forceRootLocale
@Parameter(property="forceRootLocale", defaultValue="true") private boolean forceRootLocaleForces the Javadoc JVM locale to beLocale.ROOT. This will force the Javadoc output onstdoutandstderrto be in English only and the generated HTML content in English as well. If you need the generated HTML content in another supported language uselocale.- Since:
- 3.8.0
-
disableNoFonts
@Parameter(property="maven.javadoc.disableNoFonts", defaultValue="false") private boolean disableNoFontsFrom jdk 23, javadoc now include some extra css, files which can increase the size of javadoc jar. This can be disabled using the option--no-fontsThe javadoc plugin will add this option to disable extra files to be added per default. If you prefer the new font you must set totruethe optiondisableNoFonts- Since:
- 3.11.3
-
-
Constructor Details
-
AbstractJavadocMojo
public AbstractJavadocMojo(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
-
isAggregator
protected boolean isAggregator()Indicates whether this goal is flagged with@aggregator.- Returns:
trueif the goal is designed as an aggregator,falseotherwise.- See Also:
-
isTest
protected boolean isTest()Indicates whether this goal generates documentation for theJava Test code.- Returns:
trueif the goal generates Test Javadocs,falseotherwise.
-
getOutputDirectory
-
getPluginReportOutputDirectory
Method that returns the plugin report output directory where the generated Javadoc report will be put beneathgetOutputDirectory()/AbstractMavenReport.getReportOutputDirectory().- Returns:
- a String that contains the target directory
-
getProject
protected org.apache.maven.project.MavenProject getProject() -
getProjectBuildOutputDirs
-
getClassesFile
- Parameters:
project- the project in which to find a classes file- Returns:
- null, the attached artifact file, or outputDirectory.
-
getProjectSourceRoots
-
getExecutionProjectSourceRoots
-
getJavadocDirectory
- Returns:
- the current javadoc directory
-
getDoclint
- Returns:
- the doclint specific checks configuration
-
getDoctitle
- Returns:
- the title to be placed near the top of the overview summary file
-
getOverview
- Returns:
- the overview documentation file from the user parameter or from the
javadocdirectory
-
getWindowtitle
- Returns:
- the title to be placed in the HTML title tag
-
getCharset
- Returns:
- the charset attribute or the value of
getDocencoding()ifnull.
-
getDocencoding
- Returns:
- the docencoding attribute or
UTF-8ifnull.
-
getEncoding
- Returns:
- the encoding attribute or the value of
file.encodingsystem property ifnull.
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
doExecute
protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
verifyRemovedParameter
-
verifyReplacedParameter
-
executeReport
protected void executeReport(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 Map<Path, Collection<String>> getFiles(Collection<Path> sourcePaths) throws org.apache.maven.reporting.MavenReportException Method to get the files on the specified source paths- Parameters:
sourcePaths- a Collection that contains the paths to the source files- Returns:
- a List that contains the specific path for every source file
- Throws:
org.apache.maven.reporting.MavenReportException-MavenReportExceptionissue while generating report
-
getSourcePaths
protected Collection<JavadocModule> getSourcePaths() throws org.apache.maven.reporting.MavenReportExceptionMethod to get the source paths per reactorProject. If no source path is specified in the parameter, the compile source roots of the project will be used.- Returns:
- a Map of the project absolute source paths per projects key (G:A)
- Throws:
org.apache.maven.reporting.MavenReportException-MavenReportExceptionissue while generating report- See Also:
-
buildJavadocModule
private JavadocModule buildJavadocModule(org.apache.maven.project.MavenProject project, Collection<Path> sourcePaths) -
modulesForAggregatedProject
private Set<org.apache.maven.project.MavenProject> modulesForAggregatedProject(org.apache.maven.project.MavenProject aggregatedProject, Map<Path, org.apache.maven.project.MavenProject> reactorProjectsMap) Recursively add the modules of the aggregatedProject to the set of aggregatedModules.- Parameters:
aggregatedProject- the project being aggregatedreactorProjectsMap- map of (still) available reactor projects
-
configureDependencySourceResolution
Override this method to customize the configuration for resolving dependency sources. The default behavior enables the resolution of -sources jar files.- Parameters:
config-SourceResolverConfig- Returns:
SourceResolverConfig
-
getDependencySourcePaths
protected final Collection<JavadocModule> getDependencySourcePaths() throws org.apache.maven.reporting.MavenReportExceptionResolve dependency sources so they can be included directly in the javadoc process. To customize this, overrideconfigureDependencySourceResolution(SourceResolverConfig).- Returns:
- List of source paths.
- Throws:
org.apache.maven.reporting.MavenReportException-MavenReportException
-
createDependencyArtifactFilter
private org.apache.maven.shared.artifact.filter.resolve.TransformableFilter createDependencyArtifactFilter()Returns an ArtifactFilter that only includes direct dependencies of this project (verified via groupId and artifactId). -
getDependencySourceResolverConfig
Construct a SourceResolverConfig for resolving dependency sources and resources in a consistent way, so it can be reused for both source and resource resolution.- Since:
- 2.7
-
getProjectBuildingRequest
private org.apache.maven.project.ProjectBuildingRequest getProjectBuildingRequest(org.apache.maven.project.MavenProject currentProject) -
canGenerateReport
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
-
getExcludedPackages
private String getExcludedPackages(Collection<Path> sourcePaths) throws org.apache.maven.reporting.MavenReportException Method to get the excluded source files from the javadoc and create the argument string that will be included in the javadoc commandline execution.- Parameters:
sourcePaths- the collection of paths to the source files- Returns:
- a String that contains the exclude argument that will be used by javadoc
- Throws:
org.apache.maven.reporting.MavenReportException
-
getSourcePath
Method to format the specified source paths that will be accepted by the javadoc tool.- Parameters:
sourcePaths- the list of paths to the source files that will be included in the javadoc.- Returns:
- a String that contains the formatted source path argument, separated by the System pathSeparator
string (colon (
:) on Solaris or semicolon (;) on Windows). - See Also:
-
getExcludedPackages
private Collection<String> getExcludedPackages() throws org.apache.maven.reporting.MavenReportExceptionMethod to get the packages specified in theexcludePackageNamesparameter. The packages are split with ',', ':', or ';' and then formatted.- Returns:
- an array of String objects that contain the package names
- Throws:
org.apache.maven.reporting.MavenReportException
-
trimValues
-
toResolverDependencies
-
getPathElements
Method that gets the classpath and modulepath elements that will be specified in the javadoc-classpathand--module-pathparameter. Since we have all the sources of the current reactor, it is sufficient to consider the dependencies of the reactor modules, excluding the module artifacts which may not yet be available when the reactor project is built for the first time.- Returns:
- all classpath elements
- Throws:
org.apache.maven.reporting.MavenReportException- if any.
-
getDependencyScopeFilter
protected org.eclipse.aether.util.filter.ScopeDependencyFilter getDependencyScopeFilter() -
resolveDependency
public org.apache.maven.artifact.Artifact resolveDependency(org.apache.maven.model.Dependency dependency) throws org.apache.maven.reporting.MavenReportException - Parameters:
dependency-Dependency- Returns:
Artifact- Throws:
org.apache.maven.reporting.MavenReportException- when artifact could not be resolved
-
getToolchain
protected final org.apache.maven.toolchain.Toolchain getToolchain() -
populateCompileArtifactMap
private void populateCompileArtifactMap(Map<String, org.apache.maven.artifact.Artifact> compileArtifactMap, Collection<org.apache.maven.artifact.Artifact> artifactList) throws org.apache.maven.reporting.MavenReportException Method to put the artifacts in the hashmap.- Parameters:
compileArtifactMap- the hashmap that will contain the artifactsartifactList- the list of artifacts that will be put in the map- Throws:
org.apache.maven.reporting.MavenReportException- if any
-
getBottomText
Method that sets the text that will be displayed on the bottom of the javadocs.- Returns:
- a String that contains the text that will be displayed at the bottom of the javadoc
-
getStylesheetFile
Method to get the stylesheet path file to be used by the Javadoc Tool.
If thestylesheetfileis empty, return the file as String defined bystylesheetvalue.
If thestylesheetfileis defined, return the file as String.
Note: since 2.6, thestylesheetfilecould be a path from a resource in the project source directories (i.e.src/main/java,src/main/resourcesorsrc/main/javadoc) or from a resource in the Javadoc plugin dependencies.- Parameters:
javadocOutputDirectory- the output directory- Returns:
- the stylesheet file absolute path as String.
- See Also:
-
addAddStyleSheets
-
getAddStylesheet
-
getHelpFile
Method to get the help file to be used by the Javadoc Tool.
Since 2.6, thehelpfilecould be a path from a resource in the project source directories (i.e.src/main/java,src/main/resourcesorsrc/main/javadoc) or from a resource in the Javadoc plugin dependencies.- Parameters:
javadocOutputDirectory- the output directory.- Returns:
- the help file absolute path as String.
- Since:
- 2.6
- See Also:
-
getAccessLevel
Method to get the access level for the classes and members to be shown in the generated javadoc. If the specified access level is not public, protected, package or private, the access level is set to protected.- Returns:
- the access level
-
getBootclassPath
Method to get the path of the bootclass artifacts used in the-bootclasspathoption.- Returns:
- a string that contains bootclass path, separated by the System pathSeparator string
(colon (
:) on Solaris or semicolon (;) on Windows). - Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
getDocletPath
Method to get the path of the doclet artifacts used in the-docletpathoption. Either docletArtifact or doclectArtifacts can be defined and used, not both, docletArtifact takes precedence over doclectArtifacts. docletPath is always appended to any result path definition.- Returns:
- a string that contains doclet path, separated by the System pathSeparator string
(colon (
:) on Solaris or semicolon (;) on Windows). - Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
isDocletArtifactEmpty
Verify if a doclet artifact is empty or not- Parameters:
aDocletArtifact- could be null- Returns:
trueif aDocletArtifact or the groupId/artifactId/version of the doclet artifact is null,falseotherwise.
-
getTagletPath
Method to get the path of the taglet artifacts used in the-tagletpathoption.- Returns:
- a string that contains taglet path, separated by the System pathSeparator string
(colon (
:) on Solaris or semicolon (;) on Windows). - Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
collectLinks
-
collectGroups
-
collectResourcesArtifacts
private Set<ResourcesArtifact> collectResourcesArtifacts() throws org.apache.maven.reporting.MavenReportException- Throws:
org.apache.maven.reporting.MavenReportException
-
collectBootClasspathArtifacts
private Set<BootclasspathArtifact> collectBootClasspathArtifacts() throws org.apache.maven.reporting.MavenReportException- Throws:
org.apache.maven.reporting.MavenReportException
-
collectOfflineLinks
private Set<OfflineLink> collectOfflineLinks() throws org.apache.maven.reporting.MavenReportException- Throws:
org.apache.maven.reporting.MavenReportException
-
collectTags
-
collectTagletArtifacts
private Set<TagletArtifact> collectTagletArtifacts() throws org.apache.maven.reporting.MavenReportException- Throws:
org.apache.maven.reporting.MavenReportException
-
collectDocletArtifacts
private Set<DocletArtifact> collectDocletArtifacts() throws org.apache.maven.reporting.MavenReportException- Throws:
org.apache.maven.reporting.MavenReportException
-
collectTaglets
-
getArtifactsAbsolutePath
private List<String> getArtifactsAbsolutePath(JavadocPathArtifact javadocArtifact) throws org.apache.maven.reporting.MavenReportException Return the Javadoc artifact path and its transitive dependencies path from the local repository- Parameters:
javadocArtifact- not null- Returns:
- a list of locale artifacts absolute path
- Throws:
org.apache.maven.reporting.MavenReportException- if any
-
createAndResolveArtifact
private org.apache.maven.artifact.Artifact createAndResolveArtifact(JavadocPathArtifact javadocArtifact) throws org.eclipse.aether.resolution.ArtifactResolutionException Creates anArtifactrepresenting the configuredJavadocPathArtifactand resolves it.- Parameters:
javadocArtifact- theJavadocPathArtifactto resolve- Returns:
- a resolved
Artifact - Throws:
org.eclipse.aether.resolution.ArtifactResolutionException- issue while resolving artifact
-
addMemoryArg
Method that adds/sets the java memory parameters in the command line execution.- Parameters:
cmd- the command line execution object where the argument will be addedarg- the argument parameter namememory- the JVM memory value to be set- See Also:
-
addProxyArg
private void addProxyArg(org.codehaus.plexus.util.cli.Commandline cmd) Method that adds/sets the javadoc proxy parameters in the command line execution.- Parameters:
cmd- the command line execution object where the argument will be added
-
getJavadocExecutable
Get the path of the Javadoc tool executable depending on the user entry or try to find it depending on the OS or thejava.homesystem property or theJAVA_HOMEenvironment variable.- Returns:
- the path of the Javadoc tool
- Throws:
IOException- if not found
-
setFJavadocVersion
private void setFJavadocVersion(File jExecutable) throws org.apache.maven.reporting.MavenReportException Set a new value forjavadocRuntimeVersion- Parameters:
jExecutable- not null- Throws:
org.apache.maven.reporting.MavenReportException- if not found- See Also:
-
isJavaDocVersionAtLeast
private boolean isJavaDocVersionAtLeast(org.codehaus.plexus.languages.java.version.JavaVersion requiredVersion) Is the Javadoc version at least the requested version.- Parameters:
requiredVersion- the required version, for example 1.5f- Returns:
trueif the javadoc version is equal or greater than the required version
-
addArgIf
Convenience method to add an argument to thecommand lineconditionally based on the given flag.- Parameters:
arguments- a list of arguments, not nullb- the flag which controls if the argument is added or not.value- the argument value to be added.
-
addArgIf
private void addArgIf(List<String> arguments, boolean b, String value, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion) Convenience method to add an argument to thecommand lineregarding the requested Java version.- Parameters:
arguments- a list of arguments, not nullb- the flag which controls if the argument is added or not.value- the argument value to be added.requiredJavaVersion- the required Java version, for example 1.31f or 1.4f- See Also:
-
addArgIfNotEmpty
Convenience method to add an argument to thecommand lineif the value is not null or empty. Moreover, the value could be comma separated.- Parameters:
arguments- a list of arguments, not nullkey- the argument name.value- the argument value to be added.- See Also:
-
addArgIfNotEmpty
private void addArgIfNotEmpty(List<String> arguments, String key, String value, boolean repeatKey, boolean splitValue, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion) Convenience method to add an argument to thecommand lineif the value is not null or empty. Moreover, the value could be comma separated.- Parameters:
arguments- a list of arguments, not nullkey- the argument name.value- the argument value to be added.repeatKey- repeat or not the key in the command linesplitValue- iftruegiven value will be tokenized by commarequiredJavaVersion- the required Java version, for example 1.31f or 1.4f- See Also:
-
addArgIfNotEmpty
private void addArgIfNotEmpty(List<String> arguments, String key, String value, boolean repeatKey, boolean splitValue) Convenience method to add an argument to thecommand lineif the value is not null or empty. Moreover, the value could be comma separated.- Parameters:
arguments- a list of arguments, not nullkey- the argument name.value- the argument value to be added.repeatKey- repeat or not the key in the command linesplitValue- iftruegiven value will be tokenized by comma
-
addArgIfNotEmpty
Convenience method to add an argument to thecommand lineif the value is not null or empty. Moreover, the value could be comma separated.- Parameters:
arguments- a list of arguments, not nullkey- the argument name.value- the argument value to be added.repeatKey- repeat or not the key in the command line
-
addArgIfNotEmpty
private void addArgIfNotEmpty(List<String> arguments, String key, String value, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion) Convenience method to add an argument to thecommand lineregarding the requested Java version.- Parameters:
arguments- a list of arguments, not nullkey- the argument name.value- the argument value to be added.requiredJavaVersion- the required Java version, for example 1.31f or 1.4f- See Also:
-
addArgIfNotEmpty
private void addArgIfNotEmpty(List<String> arguments, String key, String value, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion, boolean repeatKey) Convenience method to add an argument to thecommand lineregarding the requested Java version.- Parameters:
arguments- a list of arguments, not nullkey- the argument name.value- the argument value to be added.requiredJavaVersion- the required Java version, for example 1.31f or 1.4frepeatKey- repeat or not the key in the command line- See Also:
-
addLinkofflineArguments
private void addLinkofflineArguments(List<String> arguments, Set<OfflineLink> offlineLinksList) throws org.apache.maven.reporting.MavenReportException Convenience method to processofflineLinksvalues as individual-linkofflinejavadoc options.
IfdetectOfflineLinks, try to add javadoc apidocs according Maven conventions for all modules given in the project.- Parameters:
arguments- a list of arguments, not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
getOfflineLinks
- Throws:
org.apache.maven.reporting.MavenReportException
-
addLinkArguments
private void addLinkArguments(List<String> arguments) throws org.apache.maven.reporting.MavenReportException Convenience method to processlinksvalues as individual-linkjavadoc options. IfdetectLinks, try to add javadoc apidocs according Maven conventions for all dependencies given in the project.
According to the Javadoc documentation, all defined links should have${link}/package-listfetchable.
Note: when a link is not fetchable:- Javadoc 1.4 and less throw an exception
- Javadoc 1.5 and more display a warning
- Parameters:
arguments- a list of arguments, not null- Throws:
org.apache.maven.reporting.MavenReportException- issue while generating report- See Also:
-
copyAllResources
private void copyAllResources(File javadocOutputDirectory) throws org.apache.maven.reporting.MavenReportException Copy all resources to the output directory.- Parameters:
javadocOutputDirectory- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
copyJavadocResources
Method that copy alldoc-filesdirectories fromjavadocDirectoryof the current project or of the projects in the reactor to theoutputDirectory.- Parameters:
anOutputDirectory- the output directory- Throws:
IOException- if any- See Also:
-
resolveDependencyBundles
- Throws:
IOException
-
copyAdditionalJavadocResources
private void copyAdditionalJavadocResources(File anOutputDirectory) throws org.apache.maven.reporting.MavenReportException Method that copy additional Javadoc resources from given artifacts.- Parameters:
anOutputDirectory- the output directory- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
getPackageNames
-
getPackageNamesRespectingJavaModules
private Collection<String> getPackageNamesRespectingJavaModules(Collection<JavadocModule> javadocModules) throws org.apache.maven.reporting.MavenReportException - Parameters:
javadocModules- not null- Returns:
- a list of exported package names for files in allSourcePaths
- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
getFilesWithUnnamedPackages
-
getSpecialFiles
-
getModuleSourcePathFiles
-
addCommandLineOptions
private void addCommandLineOptions(org.codehaus.plexus.util.cli.Commandline cmd, List<String> arguments, File javadocOutputDirectory) throws org.apache.maven.reporting.MavenReportException Generate anoptionsfile for all options and arguments and add the@optionsin the command line.- Parameters:
cmd- not nullarguments- not nulljavadocOutputDirectory- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
addCommandLineArgFile
private void addCommandLineArgFile(org.codehaus.plexus.util.cli.Commandline cmd, File javadocOutputDirectory, List<String> files) throws org.apache.maven.reporting.MavenReportException Generate a file calledargfile(orfiles, depending on the JDK) to hold files and add the@argfile(or@file, depending on the JDK) in the command line.- Parameters:
cmd- not nulljavadocOutputDirectory- not nullfiles- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
addCommandLinePackages
private void addCommandLinePackages(org.codehaus.plexus.util.cli.Commandline cmd, File javadocOutputDirectory, Collection<String> packageNames) throws org.apache.maven.reporting.MavenReportException Generate a file calledpackagesto hold all package names and add the@packagesin the command line.- Parameters:
cmd- not nulljavadocOutputDirectory- not nullpackageNames- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
validateJavadocOptions
private void validateJavadocOptions() throws org.apache.maven.reporting.MavenReportExceptionChecks for the validity of the Javadoc options used by the user.- Throws:
org.apache.maven.reporting.MavenReportException- if error
-
validateStandardDocletOptions
private void validateStandardDocletOptions() throws org.apache.maven.reporting.MavenReportExceptionChecks for the validity of the Standard Doclet options.
For example, throw an exception if <nohelp/> and <helpfile/> options are used together.- Throws:
org.apache.maven.reporting.MavenReportException- if error or conflict found
-
addJavadocOptions
private void addJavadocOptions(File javadocOutputDirectory, List<String> arguments, Collection<JavadocModule> allSourcePaths, Set<OfflineLink> offlineLinks) throws org.apache.maven.reporting.MavenReportException Add Standard Javadoc Options.
The package documentation details the Standard Javadoc Options wrapped by this Plugin.- Parameters:
javadocOutputDirectory- not nullarguments- not nullallSourcePaths- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
getResolvePathResult
private org.codehaus.plexus.languages.java.jpms.ResolvePathResult getResolvePathResult(File artifactFile) -
findMainDescriptor
private Path findMainDescriptor(Collection<Path> roots) throws org.apache.maven.reporting.MavenReportException - Throws:
org.apache.maven.reporting.MavenReportException
-
addStandardDocletOptions
private void addStandardDocletOptions(File javadocOutputDirectory, List<String> arguments, Set<OfflineLink> offlineLinks) throws org.apache.maven.reporting.MavenReportException Add Standard Doclet Options.
The package documentation details the Standard Doclet Options wrapped by this Plugin.- Parameters:
javadocOutputDirectory- not nullarguments- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
addGroups
-
addTags
-
addTaglets
-
addTagletsFromTagletArtifacts
private void addTagletsFromTagletArtifacts(List<String> arguments) throws org.apache.maven.reporting.MavenReportException Auto-detect taglets class name fromtagletArtifactsand add them to arguments.- Parameters:
arguments- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
executeJavadocCommandLine
private void executeJavadocCommandLine(org.codehaus.plexus.util.cli.Commandline cmd, File javadocOutputDirectory) throws org.apache.maven.reporting.MavenReportException Execute the Javadoc command line- Parameters:
cmd- not nulljavadocOutputDirectory- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any errors occur
-
isUpToDate
private boolean isUpToDate(org.codehaus.plexus.util.cli.Commandline cmd) throws org.apache.maven.reporting.MavenReportException Check if the javadoc is uptodate or not- Parameters:
cmd- not null- Returns:
trueis the javadoc is uptodate,falseotherwise- Throws:
org.apache.maven.reporting.MavenReportException- if any error occur
-
doExecuteJavadocCommandLine
private void doExecuteJavadocCommandLine(org.codehaus.plexus.util.cli.Commandline cmd, File javadocOutputDirectory) throws org.apache.maven.reporting.MavenReportException Execute the Javadoc command line- Parameters:
cmd- not nulljavadocOutputDirectory- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any errors occur
-
containsWarnings
-
isInformationalOutput
Determines whether the specified string is informational output of the Javadoc tool.
Such output should not be included as exception message or logged as warning or error.The following texts are either hardcoded in the tool or can be found in versions of the javadoc tool's English resource bundle of JDK 11 (and presumably later versions).
This method will neither help nor harm for localized (non-English) versions of the tool.- Parameters:
str- string to check- Returns:
- true if informational output, false if not or cannot be determined
-
getResource
- Parameters:
outputFile- not nullinputResourceName- a not null resource insrc/main/java,src/main/resourcesorsrc/main/javadocor in the Javadoc plugin dependencies.- Returns:
- the resource file absolute path as String
- Since:
- 2.6
-
getResource
-
getFullJavadocGoal
Get the full javadoc goal. Loads the plugin's pom.properties to get the current plugin version.- Returns:
org.apache.maven.plugins:maven-javadoc-plugin:CURRENT_VERSION:[test-]javadoc
-
isDetectOfflineLinks
protected boolean isDetectOfflineLinks() -
getModulesLinks
Using Maven, a Javadoc link is given by${project.url}/apidocs.- Returns:
- the detected Javadoc links using the Maven conventions for all modules defined in the current project or an empty list
- Throws:
org.apache.maven.reporting.MavenReportException- if any- Since:
- 2.6
- See Also:
-
getDependenciesLinks
-
matches
-
getDefaultJavadocApiLink
- Returns:
- if
detectJavaApiLink, the Java API link based on thejavaApiLinksproperties and the value of thesourceparameter in theorg.apache.maven.plugins:maven-compiler-plugindefined in${project.build.plugins}or in${project.build.pluginManagement}, or thejavadocRuntimeVersion, ornullif not defined. - Since:
- 2.6
- See Also:
-
followLinks
Follows the given links if the Javadoc version is before 12, and returns their last redirect locations. Ordering is kept. This is necessary because the javadoc tool doesn't follow links, see JDK-8190312 (MJAVADOC-427, MJAVADOC-487)- Parameters:
links- Links to follow=- Returns:
- last redirect location of all the links
-
isValidJavadocLink
- Parameters:
link- not nulldetecting-trueif the link is generated bydetectLinks, orfalseotherwise- Returns:
trueif the link has a/package-list,falseotherwise.- Since:
- 2.6
- See Also:
-
writeDebugJavadocScript
-
isJavadocVMInitError
Check if the Javadoc JVM is correctly started or not.- Parameters:
output- the command line output, not null.- Returns:
trueif Javadoc output command line contains Javadoc word,falseotherwise.- Since:
- 2.6.1
- See Also:
-
getJavadocLink
- Parameters:
project- not null- Returns:
- the javadoc link based on the project URL i.e.
${project.url}/apidocs. - Since:
- 2.6
-
cleanUrl
-
getPlugin
private static org.apache.maven.model.Plugin getPlugin(org.apache.maven.project.MavenProject project, String pluginId) - Parameters:
project- not nullpluginId- not null key of the plugin defined inPluginContainer.getPluginsAsMap()or inPluginContainer.getPluginsAsMap()- Returns:
- the Maven plugin defined in
${project.build.plugins}or in${project.build.pluginManagement}, ornullif not defined - Since:
- 2.6
-
getPluginParameter
private static String getPluginParameter(org.apache.maven.project.MavenProject project, String pluginId, String param) - Parameters:
project- the Maven projectpluginId- not nullparam- not null- Returns:
- the string parameter defined in the plugin configuration by
paramkey ornullif not found. - Since:
- 2.6
-
getJavadocOptionsFile
-
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.- Returns:
JavadocOptions- Throws:
IOException-IOException- Since:
- 2.7
-
getAttachmentClassifier
Override this if you need to provide a bundle attachment classifier, as in the case of test javadocs.- Returns:
- the attachment classifier
-
logError
-
getReactorProjects
-
failOnError
-
getAggregatedProjects
- Returns:
- list of projects to be part of aggregated javadoc
-
isSkippedModule
protected boolean isSkippedModule(org.apache.maven.project.MavenProject mavenProject) - Parameters:
mavenProject- the project that might be skipped- Returns:
trueif the project needs to be skipped from aggregate generation
-
isSkippedJavadoc
protected boolean isSkippedJavadoc(org.apache.maven.project.MavenProject mavenProject) - Parameters:
mavenProject- the project that might be skipped- Returns:
trueif the pom configuration skips javadoc generation for the project
-