Class JavadocMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.eclipse.tycho.extras.docbundle.JavadocMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="javadoc", defaultPhase=PROCESS_CLASSES, requiresDependencyResolution=COMPILE_PLUS_RUNTIME, threadSafe=false) public class JavadocMojo extends org.apache.maven.plugin.AbstractMojo
Create the javadoc based API reference for this bundle
This mojo creates the javadoc documentation by calling the javadoc application from the command line. In addition it creates a ready to include toc-xml file for the Eclipse Help system.
The sources for creating the javadoc are generated automatically based on the dependency that this project has. As dependency you can specify any other maven project, for example the feature project that references you other bundles. Included features will be added to the list.- Since:
- 0.20.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
JavadocMojo.GatherClasspathVisitor
private class
JavadocMojo.GatherManifestVisitor
private class
JavadocMojo.GatherSourcesVisitor
private static interface
JavadocMojo.ProjectVisitor
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
basedir
The base output directoryprivate java.io.File
buildDirectory
The build directory where temporary build files will be placedprivate BundleReader
bundleReader
private boolean
cleanFirst
An option to clean out the whole outputDirectory first.private DocletArtifactsResolver
docletArtifactsResolver
private JavadocOptions
javadocOptions
Options for calling the javadoc application.private java.io.File
outputDirectory
The directory where the javadoc content will be generatedprivate java.lang.String
projectBuildSourceEncoding
private java.util.Map<java.lang.String,TychoProject>
projectTypes
protected java.util.List<org.apache.maven.project.MavenProject>
reactorProjects
private java.util.Set<java.lang.String>
scopes
The scopes that the dependencies must have in order to be includedprivate org.apache.maven.execution.MavenSession
session
private boolean
skipTocGen
Set this property to true to skip the generation of the Eclipse TOC files.private java.util.Set<java.lang.String>
sourceTypes
Maven module types that will be used to include the sourceprivate java.io.File
tocFile
The output location of the toc file.
This file will be overwritten.private TocOptions
tocOptions
Options for creating the toc files.private org.apache.maven.toolchain.ToolchainManager
toolchainManager
-
Constructor Summary
Constructors Constructor Description JavadocMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
cleanUp()
void
execute()
private org.apache.maven.project.MavenProject
findProject(java.lang.String groupId, java.lang.String artifactId)
void
setJavadocOptions(JavadocOptions javadocOptions)
void
setScopes(java.util.Set<java.lang.String> scopes)
void
setSourceTypes(java.util.Set<java.lang.String> sourceTypes)
void
setTocOptions(TocOptions tocOptions)
private void
visitDeps(org.apache.maven.model.Dependency dep, JavadocMojo.ProjectVisitor visitor, java.util.Set<java.lang.String> scopes)
private void
visitProjects(java.util.List<?> dependencies, java.util.Set<java.lang.String> scopes, JavadocMojo.ProjectVisitor visitor)
-
-
-
Field Detail
-
outputDirectory
@Parameter(property="outputDirectory", defaultValue="${project.build.directory}/reference/api", required=true) private java.io.File outputDirectory
The directory where the javadoc content will be generated
-
basedir
@Parameter(property="basedir", required=true, readonly=true) private java.io.File basedir
The base output directory
-
buildDirectory
@Parameter(property="project.build.directory", required=true) private java.io.File buildDirectory
The build directory where temporary build files will be placed
-
cleanFirst
@Parameter(property="cleanFirst", defaultValue="true") private boolean cleanFirst
An option to clean out the whole outputDirectory first.
-
toolchainManager
@Component private org.apache.maven.toolchain.ToolchainManager toolchainManager
-
session
@Parameter(property="session", required=true, readonly=true) private org.apache.maven.execution.MavenSession session
-
reactorProjects
@Parameter(property="reactorProjects", required=true, readonly=true) protected java.util.List<org.apache.maven.project.MavenProject> reactorProjects
-
scopes
@Parameter(property="scopes", defaultValue="compile,provided") private java.util.Set<java.lang.String> scopes
The scopes that the dependencies must have in order to be included
-
sourceTypes
@Parameter(property="sourceTypes", defaultValue="eclipse-plugin") private java.util.Set<java.lang.String> sourceTypes
Maven module types that will be used to include the source
-
javadocOptions
@Parameter(property="javadocOptions") private JavadocOptions javadocOptions
Options for calling the javadoc application. Possible options are (all options are optional):- ignoreError, specifies if errors calling javadoc should be ignored
- doclet, used as javadoc -doclet parameter
- docletArtifacts, dependencies will be resovled and added as -docletpath parameter
- encoding, used as javadoc -encoding parameter (default: ${project.build.sourceEncoding}
- additionalArguments, a list of additional arguments passed to javadoc
- includes/excludes, the list of names of packages to be included in or excluded from JavaDoc processing; use '*' character as wildcard
<configuration> <javadocOptions> <ignoreError>false</ignoreError> <encoding>UTF-8</encoding> <doclet>foo.bar.MyDoclet</doclet> <docletArtifacts> <docletArtifact> <groupId>foo.bar</groupId> <artifactId>foo.bar.mydocletartifact</artifactId> <version>1.0</version> </docletArtifact> </docletArtifacts> <includes> <include>com.example.*</include> </includes> <excludes> <exclude>com.example.internal.*</exclude> </excludes> <additionalArguments> <additionalArgument>-windowtitle "The Window Title"</additionalArgument> <additionalArgument>-nosince</additionalArgument> </additionalArguments> </javadocOptions> </configuration>
-
tocOptions
@Parameter(property="tocOptions") private TocOptions tocOptions
Options for creating the toc files.- mainLabel, specifies the main label of the toc file (default: "API Reference")
- mainFilename, specifies the filename of the TOC file (default: "overview-summary.html")
<configuration> <tocOptions> <mainLabel>My own label</mainLabel> <mainFilename>myOverviewSummary.html</mainFilename> </tocOptions> </configuration>
-
skipTocGen
@Parameter(property="skipTocGen", defaultValue="false") private boolean skipTocGen
Set this property to true to skip the generation of the Eclipse TOC files.
-
tocFile
@Parameter(property="tocFile", defaultValue="${project.build.directory}/tocjavadoc.xml") private java.io.File tocFile
The output location of the toc file.
This file will be overwritten.
-
projectBuildSourceEncoding
@Parameter(property="project.build.sourceEncoding", readonly=true) private java.lang.String projectBuildSourceEncoding
-
bundleReader
@Component private BundleReader bundleReader
-
docletArtifactsResolver
@Component private DocletArtifactsResolver docletArtifactsResolver
-
projectTypes
@Component(role=TychoProject.class) private java.util.Map<java.lang.String,TychoProject> projectTypes
-
-
Method Detail
-
setTocOptions
public void setTocOptions(TocOptions tocOptions)
-
setSourceTypes
public void setSourceTypes(java.util.Set<java.lang.String> sourceTypes)
-
setScopes
public void setScopes(java.util.Set<java.lang.String> scopes)
-
setJavadocOptions
public void setJavadocOptions(JavadocOptions javadocOptions)
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
cleanUp
private void cleanUp() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
visitProjects
private void visitProjects(java.util.List<?> dependencies, java.util.Set<java.lang.String> scopes, JavadocMojo.ProjectVisitor visitor) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
visitDeps
private void visitDeps(org.apache.maven.model.Dependency dep, JavadocMojo.ProjectVisitor visitor, java.util.Set<java.lang.String> scopes) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
findProject
private org.apache.maven.project.MavenProject findProject(java.lang.String groupId, java.lang.String artifactId)
-
-