Package org.apache.maven.plugins.javadoc
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:
JavadocJar,JavadocReport,ResourcesBundleMojo
public abstract class AbstractJavadocMojo extends org.apache.maven.plugin.AbstractMojoBase class with majority of Javadoc functionalities.- Since:
- 2.0
- See Also:
- The Java API Documentation Generator, 7
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<AdditionalDependency>additionalDependenciesCapability to add additional dependencies to the javadoc classpath.private java.lang.StringadditionalJOptionSet an additional Javadoc option(s) (i.e.private java.lang.String[]additionalJOptionsSet additional JVM options for the execution of the javadoc command via the '-J' option to javadoc.private java.lang.String[]additionalOptionsSet an additional option(s) on the command line.private booleanapplyJavadocSecurityFixTo apply the security fix on generated javadoc see http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1571private org.codehaus.plexus.archiver.manager.ArchiverManagerarchiverManagerArchiver managerprotected static java.lang.StringARGFILE_FILE_NAMETheargfilefile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @filesprivate org.apache.maven.artifact.handler.manager.ArtifactHandlerManagerartifactHandlerManagerprivate org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverartifactResolverprivate booleanauthorSpecifies whether or not the author text is included in the generated Javadocs.private java.lang.StringbootclasspathSpecifies the paths where the boot classes reside.private BootclasspathArtifact[]bootclasspathArtifactsSpecifies the artifacts where the boot classes reside.private java.lang.StringbottomSpecifies 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,
eg.private booleanbreakiteratorUses the sentence break iterator to determine the end of the first sentence.private java.lang.StringcharsetSpecifies the HTML character set for this document.private booleandebugSet this totrueto debug the Javadoc plugin.protected static java.lang.StringDEBUG_JAVADOC_SCRIPT_NAMEThe Javadoc script file name whendebugparameter is on, i.e.private static java.lang.StringDEFAULT_CSS_NAMEDefault css file nameprivate java.util.List<JavadocBundle>dependencyJavadocBundlesTransient variable to allow lazy-resolution of javadoc bundles from dependencies, so they can be used at various points in the javadoc generation process.private org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolverdependencyResolverprivate java.util.List<java.lang.String>dependencySourceExcludesList of excluded dependency-source patterns.private java.util.List<java.lang.String>dependencySourceIncludesList of included dependency-source patterns.private booleandetectJavaApiLinkDetect the Java API link for the current build, i.e.private booleandetectLinksDetect the Javadoc links for all dependencies defined in the project.private booleandetectOfflineLinksDetect the links for all modules defined in the project.private java.lang.StringdocencodingSpecifies the encoding of the generated HTML files.private booleandocfilessubdirsEnables deep copying of the**/doc-filesdirectories and the specifcresourcesdirectory from thejavadocDirectorydirectory (for instance,src/main/javadoc/com/mycompany/myapp/doc-filesandsrc/main/javadoc/resources).private java.lang.StringdocletSpecifies the class file that starts the doclet used in generating the documentation.private DocletArtifactdocletArtifactSpecifies the artifact containing the doclet starting class file (specified with the-docletoption).private DocletArtifact[]docletArtifactsSpecifies multiple artifacts containing the path for the doclet starting class file (specified with the-docletoption).private java.lang.StringdocletPathSpecifies the path to the doclet starting class file (specified with the-docletoption) and any jar files it depends on.private java.lang.StringdoclintSpecifies specific checks to be performed on Javadoc comments.private java.lang.StringdoctitleSpecifies the title to be placed near the top of the overview summary file.private static java.lang.StringELEMENT_LISTprivate java.lang.StringencodingSpecifies the encoding name of the source files.private java.lang.StringexcludedocfilessubdirExcludes any "doc-files" subdirectories with the given names.private java.lang.StringexcludePackageNamesUnconditionally excludes the specified packages and their subpackages from the list formed by-subpackages.private java.lang.StringextdirsSpecifies the directories where extension classes reside.protected booleanfailOnErrorSpecifies if the build will fail if there are errors during javadoc execution or not.protected booleanfailOnWarningsSpecifies if the build will fail if there are warning during javadoc execution or not.protected static java.lang.StringFILES_FILE_NAMEThefilesfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @filesprivate java.lang.StringfooterSpecifies the footer text to be placed at the bottom of each output file.private Group[]groupsSeparates packages on the overview page into whatever groups you specify, one group per table.private java.lang.StringheaderSpecifies the header text to be placed at the top of each output file.private java.lang.StringhelpfileSpecifies the path of an alternate help file path\filename that the HELP link in the top and bottom navigation bars link to.private booleanincludeDependencySourcesWhether dependency -sources jars should be resolved and included as source paths for javadoc generation.private booleanincludeTransitiveDependencySourcesDeprecated.if these sources depend on transitive dependencies, those dependencies should be added to the pom as direct dependenciesprivate booleanisOfflineSpecify if the Javadoc should operate in offline mode.private static org.codehaus.plexus.languages.java.version.JavaVersionJAVA_VERSIONprivate java.util.PropertiesjavaApiLinksUse this parameter only if if you want to override the default URLs.static java.lang.StringJAVADOC_RESOURCES_ATTACHMENT_CLASSIFIERClassifier used in the name of the javadoc-options XML file, and in the resources bundle artifact that gets attached to the project.private java.io.FilejavadocDirectorySpecifies the Javadoc resources directory to be included in the Javadoc (i.e.private java.lang.StringjavadocExecutableSets the absolute path of the Javadoc Tool executable to use.private java.io.FilejavadocOptionsDirDirectory into which assembledJavadocOptionsinstances will be written before they are added to javadoc resources bundles.private org.codehaus.plexus.languages.java.version.JavaVersionjavadocRuntimeVersionVersion of the Javadoc Tool executable to use.private java.lang.StringjavadocVersionVersion of the Javadoc Tool executable to use, ex.private java.util.Map<java.lang.String,java.lang.String>jdkToolchainSpecify the requirements for this jdk toolchain.private booleankeywordsAdds HTML meta keyword tags to the generated file for each class.protected java.util.ArrayList<java.lang.String>linksCreates links to existing javadoc-generated documentation of external referenced classes.private booleanlinksourceCreates an HTML version of each source file (with line numbers) and adds links to them from the standard HTML documentation.private java.lang.StringlocaleSpecifies the locale that javadoc uses when generating documentation.private org.apache.maven.artifact.repository.ArtifactRepositorylocalRepositoryThe local repository where the artifacts are located.(package private) org.codehaus.plexus.languages.java.jpms.LocationManagerlocationManagerprivate org.apache.maven.project.ProjectBuildermavenProjectBuilderProject builderprivate java.lang.StringmaxmemorySpecifies the maximum Java heap size to be used when launching the Javadoc tool.private java.lang.StringminmemorySpecifies the minimum Java heap size to be used when launching the Javadoc tool.private org.apache.maven.plugin.MojoExecutionmojoprivate booleannocommentSuppress the entire comment body, including the main description and all tags, generating only declarations.private booleannodeprecatedPrevents the generation of any deprecated API at all in the documentation.private booleannodeprecatedlistPrevents 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 booleannohelpOmits the HELP link in the navigation bars at the top and bottom of each page of output.private booleannoindexOmits the index from the generated docs.private booleannonavbarOmits the navigation bar from the generated docs.private booleannooverviewOmits the entire overview page from the generated docs.private java.lang.StringnoqualifierOmits qualifying package name from ahead of class names in output.private booleannosinceOmits from the generated docs the "Since" sections associated with the since tags.private booleannotimestampSuppresses the timestamp, which is hidden in an HTML comment in the generated HTML near the top of each page.private booleannotreeOmits the class/interface hierarchy pages from the generated docs.private OfflineLink[]offlineLinksThis option is a variation of-link; they both create links to javadoc-generated documentation for external referenced classes.private booleanoldThis option creates documentation with the appearance and functionality of documentation generated by Javadoc 1.1.protected static java.lang.StringOPTIONS_FILE_NAMETheoptionsfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @filesprotected java.io.FileoutputDirectorySpecifies the destination directory where javadoc saves the generated HTML files.private java.io.FileoverviewSpecifies 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 java.lang.StringPACKAGE_LISTprotected static java.lang.StringPACKAGES_FILE_NAMEThepackagesfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @filesprivate java.lang.StringpackagesheaderSpecify the text for upper left frame.protected org.apache.maven.project.MavenProjectprojectThe Maven Project Objectprivate booleanquietShuts off non-error and non-warning messages, leaving only the warnings and errors appear, making them easier to view.private java.util.List<org.apache.maven.project.MavenProject>reactorProjectsThe projects in the reactor for aggregation report.private java.lang.StringreleaseProvide source compatibility with specified releaseprivate static java.lang.StringRESOURCE_CSS_DIRDefault location for cssprivate static java.lang.StringRESOURCE_DIRThe current class directoryprivate ResourceResolverresourceResolverprivate ResourcesArtifact[]resourcesArtifactsA list of artifacts containing resources which should be copied into the Javadoc output directory (like stylesheets, icons, etc.).private booleanserialwarnGenerates compile-time warnings for missing serial tags.protected org.apache.maven.execution.MavenSessionsessionThe current build session instance.private org.apache.maven.settings.SettingssettingsThe Maven Settings.private java.lang.StringshowSpecifies the access level for classes and members to show in the Javadocs.private static org.codehaus.plexus.languages.java.version.JavaVersionSINCE_JAVADOC_1_4For Javadoc options appears since Java 1.4.private static org.codehaus.plexus.languages.java.version.JavaVersionSINCE_JAVADOC_1_4_2For Javadoc options appears since Java 1.4.2.private static org.codehaus.plexus.languages.java.version.JavaVersionSINCE_JAVADOC_1_5For Javadoc options appears since Java 5.0.private static org.codehaus.plexus.languages.java.version.JavaVersionSINCE_JAVADOC_1_6For Javadoc options appears since Java 6.0.private static org.codehaus.plexus.languages.java.version.JavaVersionSINCE_JAVADOC_1_8For Javadoc options appears since Java 8.0.protected booleanskipSpecifies whether the Javadoc generation should be skipped.private java.lang.StringskippedModulesComma separated list of modules (artifactId) to not add in aggregated javadocprivate java.lang.StringsourceNecessary to enable javadoc to handle assertions introduced in J2SE v 1.4 source code or generics introduced in J2SE v5.private java.io.FilesourceDependencyCacheDirDirectory where unpacked project sources / test-sources should be cached.private java.util.List<java.lang.String>sourceFileExcludesexclude filters on the source files.private java.util.List<java.lang.String>sourceFileIncludesInclude filters on the source files.private java.lang.StringsourcepathSpecifies the source paths where the subpackages are located.private intsourcetabSpecify the number of spaces each tab takes up in the source.private booleansplitindexSplits 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 java.io.FilestaleDataPathLocation of the file used to store the state of the previous javadoc run.private java.lang.StringstylesheetSpecifies whether the stylesheet to be used is themaven's javadoc stylesheet orjava's default stylesheet when a stylesheetfile parameter is not specified.private java.lang.StringstylesheetfileSpecifies the path of an alternate HTML stylesheet file.private java.lang.StringsubpackagesSpecifies the package directory where javadoc will be executed.private java.lang.StringtagletSpecifies the class file that starts the taglet used in generating the documentation for that tag.private TagletArtifacttagletArtifactSpecifies the Taglet artifact containing the taglet class files (.class).private TagletArtifact[]tagletArtifactsSpecifies several Taglet artifacts containing the taglet class files (.class).private java.lang.StringtagletpathSpecifies the search paths for finding taglet class files (.class).private Taglet[]tagletsEnables the Javadoc tool to interpret multiple taglets.private Tag[]tagsEnables the Javadoc tool to interpret a simple, one-argument custom block tag tagname in doc comments.static java.lang.StringTEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIERClassifier 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.ToolchainManagertoolchainManagerprivate java.lang.StringtopSpecifies the top text to be placed at the top of each output file.private booleanuseIncludes one "Use" page for each documented class and package.protected booleanuseStandardDocletOptionsSpecifies to use the options provided by the Standard Doclet for a custom doclet.private booleanvalidateLinksFlag controlling content validation ofpackage-listresources.private booleanverboseProvides more detailed messages while javadoc is running.private booleanversionIncludes the version text in the generated docs.private java.lang.StringwindowtitleSpecifies the title to be placed in the HTML title tag.
-
Constructor Summary
Constructors Constructor Description AbstractJavadocMojo()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private voidaddArgIf(java.util.List<java.lang.String> arguments, boolean b, java.lang.String value)Convenience method to add an argument to thecommand lineconditionally based on the given flag.private voidaddArgIf(java.util.List<java.lang.String> arguments, boolean b, java.lang.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(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.String value)Convenience method to add an argument to thecommand lineif the the value is not null or empty.private voidaddArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.String value, boolean repeatKey)Convenience method to add an argument to thecommand lineif the the value is not null or empty.private voidaddArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.String value, boolean repeatKey, boolean splitValue)Convenience method to add an argument to thecommand lineif the the value is not null or empty.private voidaddArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.String value, boolean repeatKey, boolean splitValue, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion)Convenience method to add an argument to thecommand lineif the the value is not null or empty.private voidaddArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.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(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.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, java.io.File javadocOutputDirectory, java.util.List<java.lang.String> files)Generate a file calledargfile(orfiles, depending the JDK) to hold files and add the@argfile(or@file, depending the JDK) in the command line.private voidaddCommandLineOptions(org.codehaus.plexus.util.cli.Commandline cmd, java.util.List<java.lang.String> arguments, java.io.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, java.io.File javadocOutputDirectory, java.util.List<java.lang.String> packageNames)Generate a file calledpackagesto hold all package names and add the@packagesin the command line.private voidaddGroups(java.util.List<java.lang.String> arguments)Addgroupsparameter to arguments.private voidaddJavadocOptions(java.io.File javadocOutputDirectory, java.util.List<java.lang.String> arguments, java.util.Map<java.lang.String,java.util.Collection<java.nio.file.Path>> allSourcePaths, java.util.Set<OfflineLink> offlineLinks)Add Standard Javadoc Options.private voidaddLinkArguments(java.util.List<java.lang.String> arguments)Convenience method to processlinksvalues as individual-linkjavadoc options.private voidaddLinkofflineArguments(java.util.List<java.lang.String> arguments, java.util.Set<OfflineLink> offlineLinksList)Convenience method to processofflineLinksvalues as individual-linkofflinejavadoc options.private voidaddMemoryArg(org.codehaus.plexus.util.cli.Commandline cmd, java.lang.String arg, java.lang.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(java.io.File javadocOutputDirectory, java.util.List<java.lang.String> arguments, java.util.Set<OfflineLink> offlineLinks)Add Standard Doclet Options.private voidaddTaglets(java.util.List<java.lang.String> arguments)Addtagletsparameter to arguments.private voidaddTagletsFromTagletArtifacts(java.util.List<java.lang.String> arguments)Auto-detect taglets class name fromtagletArtifactsand add them to arguments.private voidaddTags(java.util.List<java.lang.String> arguments)Addtagsparameter to arguments.protected JavadocOptionsbuildJavadocOptions()Generate a javadoc-options XML file, for either bundling with a javadoc-resources artifact OR supplying to a distro module in a includeDependencySources configuration, so the javadoc options from this execution can be reconstructed and merged in the distro build.protected booleancanGenerateReport(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> files)Method that indicates whether the javadoc can be generated or not.private static java.lang.StringcleanUrl(java.lang.String url)protected <T> java.util.Collection<T>collect(java.util.Collection<java.util.Collection<T>> sourcePaths)private java.util.Set<BootclasspathArtifact>collectBootClasspathArtifacts()private java.util.Set<DocletArtifact>collectDocletArtifacts()private java.util.Set<Group>collectGroups()private java.util.Set<java.lang.String>collectLinks()private java.util.Set<OfflineLink>collectOfflineLinks()private java.util.Set<ResourcesArtifact>collectResourcesArtifacts()private java.util.Set<TagletArtifact>collectTagletArtifacts()private java.util.Set<Taglet>collectTaglets()private java.util.Set<Tag>collectTags()protected SourceResolverConfigconfigureDependencySourceResolution(SourceResolverConfig config)Override this method to customize the configuration for resolving dependency sources.private voidcopyAdditionalJavadocResources(java.io.File anOutputDirectory)Method that copy additional Javadoc resources from given artifacts.private voidcopyAllResources(java.io.File javadocOutputDirectory)Coppy all resources to the output directoryprivate voidcopyDefaultStylesheet(java.io.File anOutputDirectory)Copies theDEFAULT_CSS_NAMEcss file from the current class loader to theoutputDirectoryonly ifstylesheetfileis empty andstylesheetis equals tomaven.private voidcopyJavadocResources(java.io.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.TransformableFiltercreateDependencyArtifactFilter()Returns a ArtifactFilter that only includes direct dependencies of this project (verified via groupId and artifactId).(package private) abstract voiddoExecute()private voiddoExecuteJavadocCommandLine(org.codehaus.plexus.util.cli.Commandline cmd, java.io.File javadocOutputDirectory)Execute the Javadoc command linevoidexecute()private voidexecuteJavadocCommandLine(org.codehaus.plexus.util.cli.Commandline cmd, java.io.File javadocOutputDirectory)Execute the Javadoc command lineprotected voidexecuteReport(java.util.Locale unusedLocale)The package documentation details the Javadoc Options used by this Plugin.protected voidfailOnError(java.lang.String prefix, java.lang.Exception e)private java.io.FilefindMainDescriptor(java.util.Collection<java.nio.file.Path> roots)private intfixFrameInjectionBug(java.io.File javadocOutputDirectory, java.lang.String outputEncoding)Patches the given Javadoc output directory to work around CVE-2013-1571 (see http://www.kb.cert.org/vuls/id/225657).private java.util.Set<java.lang.String>followLinks(java.util.Set<java.lang.String> links)Follows all of the given links, and returns their last redirect locations.private java.lang.StringgetAccessLevel()Method to get the access level for the classes and members to be shown in the generated javadoc.private java.util.List<org.apache.maven.project.MavenProject>getAggregatedProjects()protected java.io.FilegetArtifactFile(org.apache.maven.project.MavenProject project)private java.util.List<java.lang.String>getArtifactsAbsolutePath(JavadocPathArtifact javadocArtifact)Return the Javadoc artifact path and its transitive dependencies path from the local repositoryprotected java.lang.StringgetAttachmentClassifier()Override this if you need to provide a bundle attachment classifier, as in the case of test javadocs.private java.lang.StringgetBootclassPath()Method to get the path of the bootclass artifacts used in the-bootclasspathoption.private java.lang.StringgetBottomText()Method that sets the bottom text that will be displayed on the bottom of the javadocs.private java.lang.StringgetCharset()protected OfflineLinkgetDefaultJavadocApiLink()private java.util.List<java.lang.String>getDependenciesLinks()Using Maven, a Javadoc link is given by${project.url}/apidocs.protected org.apache.maven.shared.artifact.filter.resolve.ScopeFiltergetDependencyScopeFilter()protected java.util.Map<java.lang.String,java.util.Collection<java.nio.file.Path>>getDependencySourcePaths()Resolve dependency sources so they can be included directly in the javadoc process.private SourceResolverConfiggetDependencySourceResolverConfig()Construct a SourceResolverConfig for resolving dependency sources and resources in a consistent way, so it can be reused for both source and resource resolution.private java.lang.StringgetDocencoding()private java.lang.StringgetDocletPath()Method to get the path of the doclet artifacts used in the-docletpathoption.protected java.lang.StringgetDoclint()protected java.lang.StringgetDoctitle()private java.lang.StringgetEncoding()private java.util.Collection<java.lang.String>getExcludedPackages()Method to get the packages specified in theexcludePackageNamesparameter.private java.lang.StringgetExcludedPackages(java.util.Collection<java.nio.file.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.protected java.util.List<java.lang.String>getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p)protected java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>>getFiles(java.util.Collection<java.nio.file.Path> sourcePaths)Method to get the files on the specified source pathsprivate java.util.List<java.lang.String>getFilesWithUnnamedPackages(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> sourcePaths)private java.lang.StringgetFullJavadocGoal()Get the full javadoc goal.private java.lang.StringgetHelpFile(java.io.File javadocOutputDirectory)Method to get the help file to be used by the Javadoc Tool.protected java.io.FilegetJavadocDirectory()private java.lang.StringgetJavadocExecutable()Get the path of the Javadoc tool executable depending the user entry or try to find it depending the OS or thejava.homesystem property or theJAVA_HOMEenvironment variable.private static java.lang.StringgetJavadocLink(org.apache.maven.project.MavenProject p)protected java.io.FilegetJavadocOptionsFile()Construct the output file for the generated javadoc-options XML file, after creating the javadocOptionsDir if necessary.private java.util.Set<OfflineLink>getLinkofflines()private java.util.List<OfflineLink>getModulesLinks()Using Maven, a Javadoc link is given by${project.url}/apidocs.private java.util.List<java.lang.String>getModuleSourcePathFiles(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> sourcePaths)protected java.lang.StringgetOutputDirectory()protected java.io.FilegetOverview()private java.util.List<java.lang.String>getPackageNames(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> sourcePaths)private java.util.List<java.lang.String>getPackageNamesRespectingJavaModules(java.util.Map<java.lang.String,java.util.Collection<java.nio.file.Path>> allSourcePaths)private java.util.Collection<java.io.File>getPathElements()Method that gets the classpath and modulepath elements that will be specified in the javadoc-classpathand--module-pathparameter.private static org.apache.maven.model.PlugingetPlugin(org.apache.maven.project.MavenProject p, java.lang.String pluginId)private static java.lang.StringgetPluginParameter(org.apache.maven.project.MavenProject p, java.lang.String pluginId, java.lang.String param)protected org.apache.maven.project.MavenProjectgetProject()private org.apache.maven.project.ProjectBuildingRequestgetProjectBuildingRequest(org.apache.maven.project.MavenProject currentProject)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)private org.codehaus.plexus.languages.java.jpms.ResolvePathResultgetResolvePathResult(java.io.File artifactFile)private java.lang.StringgetResource(java.io.File outputFile, java.lang.String inputResourceName)private java.net.URLgetResource(java.util.List<java.lang.String> classPath, java.lang.String resource)private java.lang.StringgetSourcePath(java.util.Collection<java.nio.file.Path> sourcePaths)Method to format the specified source paths that will be accepted by the javadoc tool.protected java.util.Map<java.lang.String,java.util.Collection<java.nio.file.Path>>getSourcePaths()Method to get the source paths per reactorProject.private java.util.List<java.lang.String>getSpecialFiles(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> sourcePaths)Either return only the module descriptor or all sourcefiles per sourcepathprivate java.lang.StringgetStylesheetFile(java.io.File javadocOutputDirectory)Method to get the stylesheet path file to be used by the Javadoc Tool.private java.lang.StringgetTagletPath()Method to get the path of the taglet artifacts used in the-tagletpathoption.protected org.apache.maven.toolchain.ToolchaingetToolchain()protected java.lang.StringgetWindowtitle()protected booleanisAggregator()Indicates whether this goal is flagged with@aggregator.private booleanisDocletArtifactEmpty(DocletArtifact aDocletArtifact)Verify if a doclet artifact is empty or notprivate booleanisJavaDocVersionAtLeast(org.codehaus.plexus.languages.java.version.JavaVersion requiredVersion)Is the Javadoc version at least the requested version.private booleanisJavadocVMInitError(java.lang.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(java.lang.String link, boolean detecting)protected voidlogError(java.lang.String message, java.lang.Throwable t)Logs an error with throwable content only if in debug.private java.util.Set<org.apache.maven.project.MavenProject>modulesForAggregatedProject(org.apache.maven.project.MavenProject aggregatedProject, java.util.Map<java.nio.file.Path,org.apache.maven.project.MavenProject> reactorProjectsMap)Recursively add the modules of the aggregatedProject to the set of aggregatedModules.private voidpopulateCompileArtifactMap(java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact> compileArtifactMap, java.util.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 voidresolveDependencyBundles()private voidsetFJavadocVersion(java.io.File jExecutable)Set a new value forjavadocRuntimeVersionprivate static java.util.List<java.lang.String>trimValues(java.util.List<java.lang.String> items)private voidvalidateJavadocOptions()Checks for the validity of the Javadoc options used by the user.private voidvalidateStandardDocletOptions()Checks for the validity of the Standard Doclet options.protected voidverifyRemovedParameter(java.lang.String paramName)private voidverifyReplacedParameter(java.lang.String oldParamName, java.lang.String newParamNew)private voidwriteDebugJavadocScript(java.lang.String cmdLine, java.io.File javadocOutputDirectory)Write a debug javadoc script in case of command line error or in debug mode.
-
-
-
Field Detail
-
JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
public static final java.lang.String JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
Classifier used in the name of the javadoc-options XML file, and in the resources bundle artifact that gets attached to the project. This one is used for non-test javadocs.- Since:
- 2.7
- See Also:
TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER, Constant Field Values
-
TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
public static final java.lang.String TEST_JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER
Classifier used in the name of the javadoc-options XML file, and in the resources bundle artifact that gets attached to the project. This one is used for test-javadocs.- Since:
- 2.7
- See Also:
JAVADOC_RESOURCES_ATTACHMENT_CLASSIFIER, Constant Field Values
-
DEBUG_JAVADOC_SCRIPT_NAME
protected static final java.lang.String DEBUG_JAVADOC_SCRIPT_NAME
The Javadoc script file name whendebugparameter is on, i.e. javadoc.bat or javadoc.sh
-
OPTIONS_FILE_NAME
protected static final java.lang.String OPTIONS_FILE_NAME
Theoptionsfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @files- See Also:
- Constant Field Values
-
PACKAGES_FILE_NAME
protected static final java.lang.String PACKAGES_FILE_NAME
Thepackagesfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @files- See Also:
- Constant Field Values
-
ARGFILE_FILE_NAME
protected static final java.lang.String ARGFILE_FILE_NAME
Theargfilefile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @files- See Also:
- Constant Field Values
-
FILES_FILE_NAME
protected static final java.lang.String FILES_FILE_NAME
Thefilesfile name in the output directory when calling:javadoc.exe(or .sh) @options @packages | @argfile | @files- See Also:
- Constant Field Values
-
RESOURCE_DIR
private static final java.lang.String RESOURCE_DIR
The current class directory
-
DEFAULT_CSS_NAME
private static final java.lang.String DEFAULT_CSS_NAME
Default css file name- See Also:
- Constant Field Values
-
RESOURCE_CSS_DIR
private static final java.lang.String RESOURCE_CSS_DIR
Default location for css
-
PACKAGE_LIST
private static final java.lang.String PACKAGE_LIST
- See Also:
- Constant Field Values
-
ELEMENT_LIST
private static final java.lang.String ELEMENT_LIST
- See Also:
- Constant Field Values
-
SINCE_JAVADOC_1_4
private static final org.codehaus.plexus.languages.java.version.JavaVersion SINCE_JAVADOC_1_4
For Javadoc options appears since Java 1.4. See What's New in Javadoc 1.4- Since:
- 2.1
-
SINCE_JAVADOC_1_4_2
private static final org.codehaus.plexus.languages.java.version.JavaVersion SINCE_JAVADOC_1_4_2
For Javadoc options appears since Java 1.4.2. See What's New in Javadoc 1.4.2- Since:
- 2.1
-
SINCE_JAVADOC_1_5
private static final org.codehaus.plexus.languages.java.version.JavaVersion SINCE_JAVADOC_1_5
For Javadoc options appears since Java 5.0. See What's New in Javadoc 5.0- Since:
- 2.1
-
SINCE_JAVADOC_1_6
private static final org.codehaus.plexus.languages.java.version.JavaVersion SINCE_JAVADOC_1_6
For Javadoc options appears since Java 6.0. See Javadoc Technology- Since:
- 2.4
-
SINCE_JAVADOC_1_8
private static final org.codehaus.plexus.languages.java.version.JavaVersion SINCE_JAVADOC_1_8
For 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
-
archiverManager
@Component private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
Archiver manager- Since:
- 2.5
-
resourceResolver
@Component private ResourceResolver resourceResolver
-
artifactResolver
@Component private org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver artifactResolver
-
artifactHandlerManager
@Component private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager
-
dependencyResolver
@Component private org.apache.maven.shared.transfer.dependencies.resolve.DependencyResolver dependencyResolver
-
mavenProjectBuilder
@Component private org.apache.maven.project.ProjectBuilder mavenProjectBuilder
Project builder- Since:
- 3.0
-
toolchainManager
@Component 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
-
mojo
@Parameter(defaultValue="${mojoExecution}", readonly=true) private org.apache.maven.plugin.MojoExecution mojo
-
isOffline
@Parameter(defaultValue="${settings.offline}", required=true, readonly=true) private boolean isOfflineSpecify if the Javadoc should operate in offline mode.
-
javadocDirectory
@Parameter(defaultValue="${basedir}/src/main/javadoc") private java.io.File javadocDirectorySpecifies 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:
docfilessubdirs
-
additionalOptions
@Parameter private java.lang.String[] 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
@Parameter(property="additionalJOption") private java.lang.String additionalJOption
Set an additional Javadoc option(s) (i.e. JVM options) on the command line. Example:<additionalJOption>-J-Xss128m</additionalJOption>
See Jflag.
See vmoptions.
See Networking Properties.- Since:
- 2.3
-
additionalJOptions
@Parameter private java.lang.String[] additionalJOptions
Set additional JVM options for the execution of the javadoc command via the '-J' option to javadoc. Example:<additionalJOptions> <additionalJOption>-J-Xmx1g </additionalJOption> </additionalJOptions>- Since:
- 2.9
-
resourcesArtifacts
@Parameter(property="resourcesArtifacts") private ResourcesArtifact[] 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
-
localRepository
@Parameter(property="localRepository") private org.apache.maven.artifact.repository.ArtifactRepository localRepository
The local repository where the artifacts are located.
-
reactorProjects
@Parameter(property="reactorProjects", readonly=true) private java.util.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
@Parameter(property="javadocExecutable") private java.lang.String 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
@Parameter(property="javadocVersion") private java.lang.String 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 javadocRuntimeVersion
Version 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:
links
-
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:
offlineLinks
-
detectJavaApiLink
@Parameter(property="detectJavaApiLink", defaultValue="true") private boolean detectJavaApiLinkDetect the Java API link for the current build, i.e.http://docs.oracle.com/javase/1.4.2/docs/api/for Java source 1.4.
By default, the goal detects the Javadoc API link depending 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.
See Javadoc for the default values.- Since:
- 2.6
- See Also:
links,javaApiLinks,#DEFAULT_JAVA_API_LINKS
-
javaApiLinks
@Parameter(property="javaApiLinks") private java.util.Properties javaApiLinks
Use this parameter only if 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-listresources. If set, the content ofpackage-listresources will be validated.- Since:
- 2.8
-
bootclasspath
@Parameter(property="bootclasspath") private java.lang.String bootclasspath
Specifies the paths where the boot classes reside. Thebootclasspathcan contain multiple paths by separating them with a colon (:) or a semi-colon (;).
See bootclasspath.- Since:
- 2.5
-
bootclasspathArtifacts
@Parameter(property="bootclasspathArtifacts") private BootclasspathArtifact[] bootclasspathArtifacts
Specifies the artifacts where the boot classes reside.
See bootclasspath.
Example:<bootclasspathArtifacts> <bootclasspathArtifact> <groupId>my-groupId</groupId> <artifactId>my-artifactId</artifactId> <version>my-version</version> </bootclasspathArtifact> </bootclasspathArtifacts>
See Javadoc.- Since:
- 2.5
-
breakiterator
@Parameter(property="breakiterator", defaultValue="false") private boolean breakiteratorUses the sentence break iterator to determine the end of the first sentence.
See breakiterator.
Since Java 1.4.
-
doclet
@Parameter(property="doclet") private java.lang.String doclet
Specifies the class file that starts the doclet used in generating the documentation.
See doclet.
-
docletArtifact
@Parameter(property="docletArtifact") private DocletArtifact docletArtifact
Specifies the artifact containing the doclet starting class file (specified with the-docletoption).
See docletpath.
Example:<docletArtifact> <groupId>com.sun.tools.doclets</groupId> <artifactId>doccheck</artifactId> <version>1.2b2</version> </docletArtifact>
See Javadoc.
-
docletArtifacts
@Parameter(property="docletArtifacts") private DocletArtifact[] docletArtifacts
Specifies multiple artifacts containing the path for the doclet starting class file (specified with the-docletoption).
See docletpath.
Example:<docletArtifacts> <docletArtifact> <groupId>com.sun.tools.doclets</groupId> <artifactId>doccheck</artifactId> <version>1.2b2</version> </docletArtifact> </docletArtifacts>
See Javadoc.- Since:
- 2.1
-
docletPath
@Parameter(property="docletPath") private java.lang.String docletPath
Specifies the path to the doclet starting class file (specified with the-docletoption) and any jar files it depends on. ThedocletPathcan contain multiple paths by separating them with a colon (:) or a semi-colon (;).
See docletpath.
-
encoding
@Parameter(property="encoding", defaultValue="${project.build.sourceEncoding}") private java.lang.String encodingSpecifies the encoding name of the source files. If not specificed, the encoding value will be the value of thefile.encodingsystem property.
See encoding.
Note: In 2.4, the default value was locked toISO-8859-1to ensure reproducing build, but this was reverted in 2.5.
-
excludePackageNames
@Parameter(property="excludePackageNames") private java.lang.String 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 1 or more folders
- any other wildcard must match exactly one folder
Example:
<excludePackageNames>*.internal:org.acme.exclude1.*:org.acme.exclude2</excludePackageNames>
See exclude.
Since Java 1.4.
-
extdirs
@Parameter(property="extdirs") private java.lang.String extdirs
Specifies the directories where extension classes reside. Separate directories inextdirswith a colon (:) or a semi-colon (;).
See extdirs.
-
locale
@Parameter(property="locale") private java.lang.String locale
Specifies the locale that javadoc uses when generating documentation.
See locale.
-
maxmemory
@Parameter(property="maxmemory") private java.lang.String 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
@Parameter(property="minmemory") private java.lang.String 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
@Parameter(property="old", defaultValue="false") private boolean oldThis option creates documentation with the appearance and functionality of documentation generated by Javadoc 1.1.
See 1.1.
-
overview
@Parameter(property="overview", defaultValue="${basedir}/src/main/javadoc/overview.html") private java.io.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 with <nooverview/>.
See overview.
-
quiet
@Parameter(property="quiet", defaultValue="false") private boolean quiet
-
show
@Parameter(property="show", defaultValue="protected") private java.lang.String showSpecifies 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)
-
source
@Parameter(property="source") private java.lang.String source
-
release
@Parameter(defaultValue="${maven.compiler.release}") private java.lang.String releaseProvide source compatibility with specified release- Since:
- JDK 9, 3.1.0
-
sourcepath
@Parameter(property="sourcepath") private java.lang.String sourcepath
Specifies the source paths where the subpackages are located. Thesourcepathcan contain multiple paths by separating them with a colon (:) or a semi-colon (;).
See sourcepath.
-
subpackages
@Parameter(property="subpackages") private java.lang.String subpackages
Specifies the package directory where javadoc will be executed. Multiple packages can be separated by colons (:).
See subpackages.
Since Java 1.4.
-
verbose
@Parameter(property="verbose", defaultValue="false") private boolean verbose
-
author
@Parameter(property="author", defaultValue="true") private boolean author
-
bottom
@Parameter(property="bottom", defaultValue="Copyright © {inceptionYear}–{currentYear} {organizationName}. All rights reserved.") private java.lang.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,
eg.<![CDATA[Copyright 2005, <a href="http://www.mycompany.com">MyCompany, Inc.<a>]]>
See bottom.
-
charset
@Parameter(property="charset") private java.lang.String charset
Specifies the HTML character set for this document. If not specificed, the charset value will be the value of thedocencodingparameter.
See charset.
-
docencoding
@Parameter(property="docencoding", defaultValue="${project.reporting.outputEncoding}") private java.lang.String docencodingSpecifies the encoding of the generated HTML files. If not specificed, the docencoding value will beUTF-8.
See docencoding.
-
docfilessubdirs
@Parameter(property="docfilessubdirs", defaultValue="false") private boolean docfilessubdirsEnables deep copying of the**/doc-filesdirectories and the specifcresourcesdirectory from thejavadocDirectorydirectory (for instance,src/main/javadoc/com/mycompany/myapp/doc-filesandsrc/main/javadoc/resources).
See docfilessubdirs.
Since Java 1.4.
See javadocDirectory.- See Also:
excludedocfilessubdir,javadocDirectory
-
doclint
@Parameter(property="doclint") private java.lang.String doclint
Specifies specific checks to be performed on Javadoc comments.
See doclint.- Since:
- 3.0.0
-
doctitle
@Parameter(property="doctitle", defaultValue="${project.name} ${project.version} API") private java.lang.String doctitle
-
excludedocfilessubdir
@Parameter(property="excludedocfilessubdir") private java.lang.String excludedocfilessubdir
Excludes any "doc-files" subdirectories with the given names. Multiple patterns can be excluded by separating them with colons (:).
See excludedocfilessubdir.
Since Java 1.4.- See Also:
docfilessubdirs
-
footer
@Parameter(property="footer") private java.lang.String footer
Specifies the footer text to be placed at the bottom of each output file.
See footer.
-
groups
@Parameter private Group[] 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 group.
See Javadoc.
-
header
@Parameter(property="header") private java.lang.String header
Specifies the header text to be placed at the top of each output file.
See header.
-
helpfile
@Parameter(property="helpfile") private java.lang.String 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 helpfile.
-
keywords
@Parameter(property="keywords", defaultValue="false") private boolean keywordsAdds HTML meta keyword tags to the generated file for each class.
See keywords.
Since Java 1.4.2.
Since Java 5.0.- Since:
- 2.1
-
links
@Parameter(property="links") protected java.util.ArrayList<java.lang.String> links
Creates links to existing javadoc-generated documentation of external referenced classes.
Notes:- only used if
isOfflineis set tofalse. - all given links should have a fetchable
/package-listfile. For instance:<links> <link>http://docs.oracle.com/javase/1.4.2/docs/api</link> <links>
will be used becausehttp://docs.oracle.com/javase/1.4.2/docs/api/package-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:
detectLinks,detectJavaApiLink
- only used if
-
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 linksource.
Since Java 1.4.
-
nocomment
@Parameter(property="nocomment", defaultValue="false") private boolean nocomment
-
nodeprecated
@Parameter(property="nodeprecated", defaultValue="false") private boolean nodeprecated
-
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 nodeprecatedlist.
-
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 with <helpfile/>.
See nohelp.
-
noindex
@Parameter(property="noindex", defaultValue="false") private boolean noindexOmits the index from the generated docs.
Note: could be in conflict with <splitindex/>.
See noindex.
-
nonavbar
@Parameter(property="nonavbar", defaultValue="false") private boolean nonavbar
-
nooverview
@Parameter(property="nooverview", defaultValue="false") private boolean nooverviewOmits the entire overview page from the generated docs.
Note: could be in conflict with <overview/>.
Standard Doclet undocumented option.- Since:
- 2.4
-
noqualifier
@Parameter(property="noqualifier") private java.lang.String noqualifier
Omits qualifying package name from ahead of class names in output. Example:<noqualifier>all</noqualifier> or <noqualifier>packagename1:packagename2</noqualifier>
See noqualifier.
Since Java 1.4.
-
nosince
@Parameter(property="nosince", defaultValue="false") private boolean nosince
-
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.
See notimestamp.
Since Java 5.0.- Since:
- 2.1
-
notree
@Parameter(property="notree", defaultValue="false") private boolean notreeOmits the class/interface hierarchy pages from the generated docs.- See Also:
- notree option
-
offlineLinks
@Parameter(property="offlineLinks") private OfflineLink[] offlineLinks
This option is a variation of-link; they both create links to javadoc-generated documentation for external referenced classes.
See linkoffline.
Example:<offlineLinks> <offlineLink> <url>http://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:
- Javadoc.
-
outputDirectory
@Parameter(property="destDir", alias="destDir", defaultValue="${project.build.directory}/apidocs", required=true) protected java.io.File outputDirectorySpecifies the destination directory where javadoc saves the generated HTML files.- See Also:
- javadoc d
-
packagesheader
@Parameter(property="packagesheader") private java.lang.String packagesheader
Specify the text for upper left frame.
Since Java 1.4.2.- Since:
- 2.1
-
serialwarn
@Parameter(property="serialwarn", defaultValue="false") private boolean serialwarnGenerates compile-time warnings for missing serial tags.- See Also:
- serialwarn option
-
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.
Note: waslinksourcetabin Java 1.4.2 (refer to bug ID 4788919).
Since 1.4.2.
Since Java 5.0.- Since:
- 2.1
-
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 with <noindex/>.
See splitindex.
-
stylesheet
@Parameter(property="stylesheet", defaultValue="java") private java.lang.String stylesheetSpecifies whether the stylesheet to be used is themaven's javadoc stylesheet orjava's default stylesheet when a stylesheetfile parameter is not specified.
Possible values:mavenorjava.
-
stylesheetfile
@Parameter(property="stylesheetfile") private java.lang.String 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 stylesheetfile.
-
taglet
@Parameter(property="taglet") private java.lang.String taglet
-
tagletArtifact
@Parameter(property="tagletArtifact") private TagletArtifact tagletArtifact
Specifies the Taglet artifact containing the taglet class files (.class).
See tagletpath.
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
-
tagletArtifacts
@Parameter(property="tagletArtifacts") private TagletArtifact[] tagletArtifacts
Specifies several Taglet artifacts containing the taglet class files (.class). These taglets class names will be auto-detect and so no need to specify them.
See taglet.
See tagletpath.
Example:<tagletArtifacts> <tagletArtifact> <groupId>group-Taglet</groupId> <artifactId>artifact-Taglet</artifactId> <version>version-Taglet</version> </tagletArtifact> ... </tagletArtifacts>
See Javadoc.- Since:
- 2.5
-
tagletpath
@Parameter(property="tagletpath") private java.lang.String tagletpath
Specifies the search paths for finding taglet class files (.class). Thetagletpathcan contain multiple paths by separating them with a colon (:) or a semi-colon (;).
See tagletpath.
Since Java 1.4.
-
taglets
@Parameter(property="taglets") private Taglet[] taglets
Enables the Javadoc tool to interpret multiple taglets.
See taglet.
See tagletpath.
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
-
tags
@Parameter(property="tags") private Tag[] tags
Enables the Javadoc tool to interpret a simple, one-argument custom block tag tagname in doc comments.
See tag.
Since Java 1.4.
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)
-
top
@Parameter(property="top") private java.lang.String top
- Since:
- 2.4
-
use
@Parameter(property="use", defaultValue="true") private boolean use
-
version
@Parameter(property="version", defaultValue="true") private boolean version
-
windowtitle
@Parameter(property="windowtitle", defaultValue="${project.name} ${project.version} API") private java.lang.String windowtitle
-
includeDependencySources
@Parameter(defaultValue="false") private boolean includeDependencySources
Whether 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 java.io.File sourceDependencyCacheDirDirectory where unpacked project sources / test-sources should be cached.- Since:
- 2.7
- See Also:
includeDependencySources
-
includeTransitiveDependencySources
@Parameter(defaultValue="false") @Deprecated private boolean 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:
includeDependencySources
-
dependencySourceIncludes
@Parameter private java.util.List<java.lang.String> dependencySourceIncludes
List of included dependency-source patterns. Example:org.apache.maven:*- Since:
- 2.7
- See Also:
includeDependencySources
-
dependencySourceExcludes
@Parameter private java.util.List<java.lang.String> dependencySourceExcludes
List of excluded dependency-source patterns. Example:org.apache.maven.shared:*- Since:
- 2.7
- See Also:
includeDependencySources
-
javadocOptionsDir
@Parameter(defaultValue="${project.build.directory}/javadoc-bundle-options", readonly=true) private java.io.File javadocOptionsDirDirectory into which assembledJavadocOptionsinstances will be written before they are added to javadoc resources bundles.- Since:
- 2.7
-
dependencyJavadocBundles
private transient java.util.List<JavadocBundle> 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
@Parameter private java.util.List<AdditionalDependency> 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
@Parameter private java.util.List<java.lang.String> sourceFileIncludes
Include filters on the source files. Default is **\/\*.java. These are ignored if you specify subpackages or subpackage excludes.- Since:
- 2.9
-
sourceFileExcludes
@Parameter private java.util.List<java.lang.String> sourceFileExcludes
exclude filters on the source files. These are ignored if you specify subpackages or subpackage excludes.- Since:
- 2.9
-
applyJavadocSecurityFix
@Parameter(defaultValue="true", property="maven.javadoc.applyJavadocSecurityFix") private boolean applyJavadocSecurityFixTo apply the security fix on generated javadoc see http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1571- Since:
- 2.9.1
-
jdkToolchain
@Parameter private java.util.Map<java.lang.String,java.lang.String> jdkToolchain
Specify the requirements for this jdk toolchain. This overrules the toolchain selected by the maven-toolchain-plugin.
note: requires at least Maven 3.3.1- Since:
- 3.0.0
-
staleDataPath
@Parameter(property="staleDataPath", defaultValue="${project.build.directory}/maven-javadoc-plugin-stale-data.txt") private java.io.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
@Parameter(property="maven.javadoc.skippedModules") private java.lang.String skippedModules
Comma separated list of modules (artifactId) to not add in aggregated javadoc
- Since:
- 3.2.0
-
-
Method Detail
-
isAggregator
protected boolean isAggregator()
Indicates whether this goal is flagged with@aggregator.- Returns:
trueif the goal is designed as an aggregator,falseotherwise.- See Also:
AggregatorJavadocReport,AggregatorTestJavadocReport
-
isTest
protected boolean isTest()
Indicates whether this goal generates documentation for theJava Test code.- Returns:
trueif the goal generates Test Javadocs,falseotherwise.
-
getOutputDirectory
protected java.lang.String getOutputDirectory()
- Returns:
- the output directory
-
getProject
protected org.apache.maven.project.MavenProject getProject()
-
getProjectBuildOutputDirs
protected java.util.List<java.io.File> getProjectBuildOutputDirs(org.apache.maven.project.MavenProject p)
- Parameters:
p- not null maven project- Returns:
- the list of directories where compiled classes are placed for the given project. These dirs are added in the javadoc classpath.
-
getArtifactFile
protected java.io.File getArtifactFile(org.apache.maven.project.MavenProject project)
-
getProjectSourceRoots
protected java.util.List<java.lang.String> getProjectSourceRoots(org.apache.maven.project.MavenProject p)
- Parameters:
p- not null maven project- Returns:
- the list of source paths for the given project
-
getExecutionProjectSourceRoots
protected java.util.List<java.lang.String> getExecutionProjectSourceRoots(org.apache.maven.project.MavenProject p)
- Parameters:
p- not null maven project- Returns:
- the list of source paths for the execution project of the given project
-
getJavadocDirectory
protected java.io.File getJavadocDirectory()
- Returns:
- the current javadoc directory
-
getDoclint
protected java.lang.String getDoclint()
- Returns:
- the doclint specific checks configuration
-
getDoctitle
protected java.lang.String getDoctitle()
- Returns:
- the title to be placed near the top of the overview summary file
-
getOverview
protected java.io.File getOverview()
- Returns:
- the overview documentation file from the user parameter or from the
javadocdirectory
-
getWindowtitle
protected java.lang.String getWindowtitle()
- Returns:
- the title to be placed in the HTML title tag
-
getCharset
private java.lang.String getCharset()
- Returns:
- the charset attribute or the value of
getDocencoding()ifnull.
-
getDocencoding
private java.lang.String getDocencoding()
- Returns:
- the docencoding attribute or
UTF-8ifnull.
-
getEncoding
private java.lang.String 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
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
protected final void verifyRemovedParameter(java.lang.String paramName)
-
verifyReplacedParameter
private void verifyReplacedParameter(java.lang.String oldParamName, java.lang.String newParamNew)
-
executeReport
protected void executeReport(java.util.Locale unusedLocale) throws org.apache.maven.reporting.MavenReportExceptionThe 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
-
collect
protected final <T> java.util.Collection<T> collect(java.util.Collection<java.util.Collection<T>> sourcePaths)
-
getFiles
protected java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> getFiles(java.util.Collection<java.nio.file.Path> sourcePaths) throws org.apache.maven.reporting.MavenReportExceptionMethod 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 java.util.Map<java.lang.String,java.util.Collection<java.nio.file.Path>> 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:
JavadocUtil.pruneDirs(MavenProject, Collection)
-
modulesForAggregatedProject
private java.util.Set<org.apache.maven.project.MavenProject> modulesForAggregatedProject(org.apache.maven.project.MavenProject aggregatedProject, java.util.Map<java.nio.file.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
protected SourceResolverConfig configureDependencySourceResolution(SourceResolverConfig config)
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 java.util.Map<java.lang.String,java.util.Collection<java.nio.file.Path>> 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 a ArtifactFilter that only includes direct dependencies of this project (verified via groupId and artifactId).- Returns:
-
getDependencySourceResolverConfig
private SourceResolverConfig 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
protected boolean canGenerateReport(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> files)
Method that indicates whether the javadoc can be generated or not. If the project does not contain any source files and no subpackages are specified, the plugin will terminate.- Parameters:
files- the project files- Returns:
- a boolean that indicates whether javadoc report can be generated or not
-
getExcludedPackages
private java.lang.String getExcludedPackages(java.util.Collection<java.nio.file.Path> sourcePaths) throws org.apache.maven.reporting.MavenReportExceptionMethod to get the excluded source files from the javadoc and create the argument string that will be included in the javadoc commandline execution.- Parameters:
sourceFolders- 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
private java.lang.String getSourcePath(java.util.Collection<java.nio.file.Path> sourcePaths)
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 semi-colon (;) on Windows). - See Also:
File.pathSeparator
-
getExcludedPackages
private java.util.Collection<java.lang.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
private static java.util.List<java.lang.String> trimValues(java.util.List<java.lang.String> items)
-
getPathElements
private java.util.Collection<java.io.File> getPathElements() throws org.apache.maven.reporting.MavenReportExceptionMethod 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.apache.maven.shared.artifact.filter.resolve.ScopeFilter 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(java.util.Map<java.lang.String,org.apache.maven.artifact.Artifact> compileArtifactMap, java.util.Collection<org.apache.maven.artifact.Artifact> artifactList) throws org.apache.maven.reporting.MavenReportExceptionMethod 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
private java.lang.String getBottomText()
Method that sets the bottom 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
private java.lang.String getStylesheetFile(java.io.File javadocOutputDirectory)
Method to get the stylesheet path file to be used by the Javadoc Tool.
If thestylesheetfileis empty, return the file as String definded 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:
getResource(List, String)
-
getHelpFile
private java.lang.String getHelpFile(java.io.File javadocOutputDirectory)
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:
getResource(File, String)
-
getAccessLevel
private java.lang.String 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
private java.lang.String getBootclassPath() throws org.apache.maven.reporting.MavenReportExceptionMethod 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 semi-colon (;) on Windows). - Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
File.pathSeparator
-
getDocletPath
private java.lang.String getDocletPath() throws org.apache.maven.reporting.MavenReportExceptionMethod 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 semi-colon (;) on Windows). - Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
File.pathSeparator
-
isDocletArtifactEmpty
private boolean isDocletArtifactEmpty(DocletArtifact aDocletArtifact)
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
private java.lang.String getTagletPath() throws org.apache.maven.reporting.MavenReportExceptionMethod 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 semi-colon (;) on Windows). - Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
File.pathSeparator
-
collectLinks
private java.util.Set<java.lang.String> collectLinks() throws org.apache.maven.reporting.MavenReportException- Throws:
org.apache.maven.reporting.MavenReportException
-
collectGroups
private java.util.Set<Group> collectGroups() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
collectResourcesArtifacts
private java.util.Set<ResourcesArtifact> collectResourcesArtifacts() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
collectBootClasspathArtifacts
private java.util.Set<BootclasspathArtifact> collectBootClasspathArtifacts() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
collectOfflineLinks
private java.util.Set<OfflineLink> collectOfflineLinks() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
collectTags
private java.util.Set<Tag> collectTags() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
collectTagletArtifacts
private java.util.Set<TagletArtifact> collectTagletArtifacts() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
collectDocletArtifacts
private java.util.Set<DocletArtifact> collectDocletArtifacts() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
collectTaglets
private java.util.Set<Taglet> collectTaglets() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
getArtifactsAbsolutePath
private java.util.List<java.lang.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.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException
creates anArtifactrepresenting the configuredJavadocPathArtifactand resolves it.- Parameters:
javadocArtifact- theJavadocPathArtifactto resolve- Returns:
- a resolved
Artifact - Throws:
org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolverException- issue while resolving artifact
-
addMemoryArg
private void addMemoryArg(org.codehaus.plexus.util.cli.Commandline cmd, java.lang.String arg, java.lang.String memory)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:
JavadocUtil.parseJavadocMemory(String)
-
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
private java.lang.String getJavadocExecutable() throws java.io.IOExceptionGet the path of the Javadoc tool executable depending the user entry or try to find it depending the OS or thejava.homesystem property or theJAVA_HOMEenvironment variable.- Returns:
- the path of the Javadoc tool
- Throws:
java.io.IOException- if not found
-
setFJavadocVersion
private void setFJavadocVersion(java.io.File jExecutable) throws org.apache.maven.reporting.MavenReportExceptionSet a new value forjavadocRuntimeVersion- Parameters:
jExecutable- not null- Throws:
org.apache.maven.reporting.MavenReportException- if not found- See Also:
JavadocUtil.getJavadocVersion(File)
-
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
private void addArgIf(java.util.List<java.lang.String> arguments, boolean b, java.lang.String value)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(java.util.List<java.lang.String> arguments, boolean b, java.lang.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:
addArgIf(List, boolean, String),isJavaDocVersionAtLeast(JavaVersion)
-
addArgIfNotEmpty
private void addArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.String value)Convenience method to add an argument to thecommand lineif the 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(List, String, String, boolean)
-
addArgIfNotEmpty
private void addArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.String value, boolean repeatKey, boolean splitValue, org.codehaus.plexus.languages.java.version.JavaVersion requiredJavaVersion)Convenience method to add an argument to thecommand lineif the 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(List, String, String, boolean, boolean),isJavaDocVersionAtLeast(JavaVersion)
-
addArgIfNotEmpty
private void addArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.String value, boolean repeatKey, boolean splitValue)Convenience method to add an argument to thecommand lineif the 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
private void addArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.String value, boolean repeatKey)Convenience method to add an argument to thecommand lineif the 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(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.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(List, String, String, JavaVersion, boolean)
-
addArgIfNotEmpty
private void addArgIfNotEmpty(java.util.List<java.lang.String> arguments, java.lang.String key, java.lang.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:
addArgIfNotEmpty(List, String, String),isJavaDocVersionAtLeast(org.codehaus.plexus.languages.java.version.JavaVersion)
-
addLinkofflineArguments
private void addLinkofflineArguments(java.util.List<java.lang.String> arguments, java.util.Set<OfflineLink> offlineLinksList) throws org.apache.maven.reporting.MavenReportExceptionConvenience 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:
offlineLinks,getModulesLinks(), package-list spec
-
getLinkofflines
private java.util.Set<OfflineLink> getLinkofflines() throws org.apache.maven.reporting.MavenReportException
- Throws:
org.apache.maven.reporting.MavenReportException
-
addLinkArguments
private void addLinkArguments(java.util.List<java.lang.String> arguments) throws org.apache.maven.reporting.MavenReportExceptionConvenience method to processlinksvalues as individual-linkjavadoc options. IfdetectLinks, try to add javadoc apidocs according Maven conventions for all dependencies given in the project.
According the Javadoc documentation, all defined link 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:
detectLinks,getDependenciesLinks(), package-list spec
-
copyAllResources
private void copyAllResources(java.io.File javadocOutputDirectory) throws org.apache.maven.reporting.MavenReportExceptionCoppy all resources to the output directory- Parameters:
javadocOutputDirectory- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
copyDefaultStylesheet(File),copyJavadocResources(File),copyAdditionalJavadocResources(File)
-
copyDefaultStylesheet
private void copyDefaultStylesheet(java.io.File anOutputDirectory) throws java.io.IOExceptionCopies theDEFAULT_CSS_NAMEcss file from the current class loader to theoutputDirectoryonly ifstylesheetfileis empty andstylesheetis equals tomaven.- Parameters:
anOutputDirectory- the output directory- Throws:
java.io.IOException- if any- See Also:
DEFAULT_CSS_NAME,JavadocUtil.copyResource(java.net.URL, java.io.File)
-
copyJavadocResources
private void copyJavadocResources(java.io.File anOutputDirectory) throws java.io.IOExceptionMethod that copy alldoc-filesdirectories fromjavadocDirectoryof the current project or of the projects in the reactor to theoutputDirectory.- Parameters:
anOutputDirectory- the output directory- Throws:
java.io.IOException- if any- See Also:
- Reference
Guide, Copies new "doc-files" directory for holding images and examples,
docfilessubdirs
-
resolveDependencyBundles
private void resolveDependencyBundles() throws java.io.IOException- Throws:
java.io.IOException
-
copyAdditionalJavadocResources
private void copyAdditionalJavadocResources(java.io.File anOutputDirectory) throws org.apache.maven.reporting.MavenReportExceptionMethod that copy additional Javadoc resources from given artifacts.- Parameters:
anOutputDirectory- the output directory- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
resourcesArtifacts
-
getPackageNames
private java.util.List<java.lang.String> getPackageNames(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> sourcePaths)
- Parameters:
sourcePaths- could be null- Returns:
- the list of package names for files in the sourcePaths
-
getPackageNamesRespectingJavaModules
private java.util.List<java.lang.String> getPackageNamesRespectingJavaModules(java.util.Map<java.lang.String,java.util.Collection<java.nio.file.Path>> allSourcePaths) throws org.apache.maven.reporting.MavenReportException- Parameters:
allSourcePaths- not null, containing absolute and relative paths- Returns:
- a list of exported package names for files in allSourcePaths
- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
getFiles(java.util.Collection<java.nio.file.Path>),getSourcePaths()
-
getFilesWithUnnamedPackages
private java.util.List<java.lang.String> getFilesWithUnnamedPackages(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> sourcePaths)
- Parameters:
sourcePaths- could be null- Returns:
- a list files with unnamed package names for files in the sourcePaths
-
getSpecialFiles
private java.util.List<java.lang.String> getSpecialFiles(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> sourcePaths)
Either return only the module descriptor or all sourcefiles per sourcepath- Parameters:
sourcePaths- could be null- Returns:
- a list of files
-
getModuleSourcePathFiles
private java.util.List<java.lang.String> getModuleSourcePathFiles(java.util.Map<java.nio.file.Path,java.util.Collection<java.lang.String>> sourcePaths)
-
addCommandLineOptions
private void addCommandLineOptions(org.codehaus.plexus.util.cli.Commandline cmd, java.util.List<java.lang.String> arguments, java.io.File javadocOutputDirectory) throws org.apache.maven.reporting.MavenReportExceptionGenerate 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:
-
Reference Guide, Command line argument files,
OPTIONS_FILE_NAME
-
addCommandLineArgFile
private void addCommandLineArgFile(org.codehaus.plexus.util.cli.Commandline cmd, java.io.File javadocOutputDirectory, java.util.List<java.lang.String> files) throws org.apache.maven.reporting.MavenReportExceptionGenerate a file calledargfile(orfiles, depending the JDK) to hold files and add the@argfile(or@file, depending the JDK) in the command line.- Parameters:
cmd- not nulljavadocOutputDirectory- not nullfiles- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
-
Reference Guide, Command line argument files
,
What s New in Javadoc 1.4
,
isJavaDocVersionAtLeast(JavaVersion),ARGFILE_FILE_NAME,FILES_FILE_NAME
-
addCommandLinePackages
private void addCommandLinePackages(org.codehaus.plexus.util.cli.Commandline cmd, java.io.File javadocOutputDirectory, java.util.List<java.lang.String> packageNames) throws org.apache.maven.reporting.MavenReportExceptionGenerate 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:
-
Reference Guide, Command line argument files,
PACKAGES_FILE_NAME
-
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(java.io.File javadocOutputDirectory, java.util.List<java.lang.String> arguments, java.util.Map<java.lang.String,java.util.Collection<java.nio.file.Path>> allSourcePaths, java.util.Set<OfflineLink> offlineLinks) throws org.apache.maven.reporting.MavenReportExceptionAdd 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:
- http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#javadocoptions
-
getResolvePathResult
private org.codehaus.plexus.languages.java.jpms.ResolvePathResult getResolvePathResult(java.io.File artifactFile)
-
findMainDescriptor
private java.io.File findMainDescriptor(java.util.Collection<java.nio.file.Path> roots) throws org.apache.maven.reporting.MavenReportException- Throws:
org.apache.maven.reporting.MavenReportException
-
addStandardDocletOptions
private void addStandardDocletOptions(java.io.File javadocOutputDirectory, java.util.List<java.lang.String> arguments, java.util.Set<OfflineLink> offlineLinks) throws org.apache.maven.reporting.MavenReportExceptionAdd 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:
- http://docs.oracle.com/javase/7/docs/technotes/tools/windows/javadoc.html#standard
-
addGroups
private void addGroups(java.util.List<java.lang.String> arguments) throws org.apache.maven.reporting.MavenReportExceptionAddgroupsparameter to arguments.- Parameters:
arguments- not null- Throws:
org.apache.maven.reporting.MavenReportException
-
addTags
private void addTags(java.util.List<java.lang.String> arguments) throws org.apache.maven.reporting.MavenReportExceptionAddtagsparameter to arguments.- Parameters:
arguments- not null- Throws:
org.apache.maven.reporting.MavenReportException
-
addTaglets
private void addTaglets(java.util.List<java.lang.String> arguments)
Addtagletsparameter to arguments.- Parameters:
arguments- not null
-
addTagletsFromTagletArtifacts
private void addTagletsFromTagletArtifacts(java.util.List<java.lang.String> arguments) throws org.apache.maven.reporting.MavenReportExceptionAuto-detect taglets class name fromtagletArtifactsand add them to arguments.- Parameters:
arguments- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any- See Also:
JavadocUtil.getTagletClassNames(File)
-
executeJavadocCommandLine
private void executeJavadocCommandLine(org.codehaus.plexus.util.cli.Commandline cmd, java.io.File javadocOutputDirectory) throws org.apache.maven.reporting.MavenReportExceptionExecute 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.MavenReportExceptionCheck 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, java.io.File javadocOutputDirectory) throws org.apache.maven.reporting.MavenReportExceptionExecute the Javadoc command line- Parameters:
cmd- not nulljavadocOutputDirectory- not null- Throws:
org.apache.maven.reporting.MavenReportException- if any errors occur
-
fixFrameInjectionBug
private int fixFrameInjectionBug(java.io.File javadocOutputDirectory, java.lang.String outputEncoding) throws java.io.IOExceptionPatches the given Javadoc output directory to work around CVE-2013-1571 (see http://www.kb.cert.org/vuls/id/225657).- Parameters:
javadocOutputDirectory- directory to scan for vulnerabilitiesoutputEncoding- encoding used by the javadoc tool (-docencoding parameter). Ifnull, the platform's default encoding is used (like javadoc does).- Returns:
- the number of patched files
- Throws:
java.io.IOException
-
getResource
private java.lang.String getResource(java.io.File outputFile, java.lang.String inputResourceName)- Parameters:
outputFile- not nulinputResourceName- 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
private java.net.URL getResource(java.util.List<java.lang.String> classPath, java.lang.String resource)- Parameters:
classPath- a not null String list of files where resource will be look up.resource- a not null ressource to find in the class path.- Returns:
- the resource from the given classpath or null if not found
- Since:
- 2.6
- See Also:
ClassLoader.getResource(String)
-
getFullJavadocGoal
private java.lang.String 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
-
getModulesLinks
private java.util.List<OfflineLink> getModulesLinks() throws org.apache.maven.reporting.MavenReportException
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:
detectOfflineLinks,reactorProjects
-
getDependenciesLinks
private java.util.List<java.lang.String> getDependenciesLinks()
Using Maven, a Javadoc link is given by${project.url}/apidocs.- Returns:
- the detected Javadoc links using the Maven conventions for all dependencies defined in the current project or an empty list.
- Since:
- 2.6
- See Also:
detectLinks,isValidJavadocLink(java.lang.String, boolean)
-
getDefaultJavadocApiLink
protected final OfflineLink 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:
detectJavaApiLink,javaApiLinks, source parameter
-
followLinks
private java.util.Set<java.lang.String> followLinks(java.util.Set<java.lang.String> links)
Follows all of the given links, and returns their last redirect locations. Ordering is kept. This is necessary because 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
protected boolean isValidJavadocLink(java.lang.String link, boolean detecting)- 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:
- package-list spec
-
writeDebugJavadocScript
private void writeDebugJavadocScript(java.lang.String cmdLine, java.io.File javadocOutputDirectory)Write a debug javadoc script in case of command line error or in debug mode.- Parameters:
cmdLine- the current command line as string, not null.javadocOutputDirectory- the output dir, not null.- Since:
- 2.6
- See Also:
executeJavadocCommandLine(Commandline, File)
-
isJavadocVMInitError
private boolean isJavadocVMInitError(java.lang.String output)
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:
executeJavadocCommandLine(Commandline, File)
-
getJavadocLink
private static java.lang.String getJavadocLink(org.apache.maven.project.MavenProject p)
- Parameters:
p- not null- Returns:
- the javadoc link based on the project url i.e.
${project.url}/${destDir}wheredestDiris configued in the Javadoc plugin configuration (apidocsby default). - Since:
- 2.6
-
cleanUrl
private static java.lang.String cleanUrl(java.lang.String url)
- Parameters:
url- could be null.- Returns:
- the url cleaned or empty if url was null.
- Since:
- 2.6
-
getPlugin
private static org.apache.maven.model.Plugin getPlugin(org.apache.maven.project.MavenProject p, java.lang.String pluginId)- Parameters:
p- 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 java.lang.String getPluginParameter(org.apache.maven.project.MavenProject p, java.lang.String pluginId, java.lang.String param)- Parameters:
p- not nullpluginId- not nullparam- not null- Returns:
- the simple parameter as String defined in the plugin configuration by
paramkey ornullif not found. - Since:
- 2.6
-
getJavadocOptionsFile
protected final java.io.File getJavadocOptionsFile()
Construct the output file for the generated javadoc-options XML file, after creating the javadocOptionsDir if necessary. This method does NOT write to the file in question.- Returns:
- The options
Filefile. - Since:
- 2.7
-
buildJavadocOptions
protected final JavadocOptions buildJavadocOptions() throws java.io.IOException
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:
java.io.IOException-IOException- Since:
- 2.7
-
getAttachmentClassifier
protected java.lang.String getAttachmentClassifier()
Override this if you need to provide a bundle attachment classifier, as in the case of test javadocs.- Returns:
- The attachment classifier.
-
logError
protected void logError(java.lang.String message, java.lang.Throwable t)Logs an error with throwable content only if in debug.- Parameters:
message- The message which should be announced.t- The throwable part of the message.
-
failOnError
protected void failOnError(java.lang.String prefix, java.lang.Exception e) throws org.apache.maven.plugin.MojoExecutionException- Parameters:
prefix- The prefix of the exception.e- The exception.- Throws:
org.apache.maven.plugin.MojoExecutionException-MojoExecutionExceptionissue while generating report
-
getAggregatedProjects
private java.util.List<org.apache.maven.project.MavenProject> getAggregatedProjects()
- Returns:
- List of projects to be part of aggregated javadoc
-
isSkippedModule
protected boolean isSkippedModule(org.apache.maven.project.MavenProject mavenProject)
- Returns:
trueif the module need to be skipped from aggregate generation
-
isSkippedJavadoc
protected boolean isSkippedJavadoc(org.apache.maven.project.MavenProject mavenProject)
- Returns:
trueif the pom configuration skip javadoc generation for the project
-
-