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.AbstractMojoCreate 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 classJavadocMojo.GatherClasspathVisitorprivate classJavadocMojo.GatherManifestVisitorprivate classJavadocMojo.GatherSourcesVisitorprivate static interfaceJavadocMojo.ProjectVisitor
-
Field Summary
Fields Modifier and Type Field Description private java.io.FilebasedirThe base output directoryprivate java.io.FilebuildDirectoryThe build directory where temporary build files will be placedprivate BundleReaderbundleReaderprivate booleancleanFirstAn option to clean out the whole outputDirectory first.private DocletArtifactsResolverdocletArtifactsResolverprivate JavadocOptionsjavadocOptionsOptions for calling the javadoc application.private java.io.FileoutputDirectoryThe directory where the javadoc content will be generatedprivate java.lang.StringprojectBuildSourceEncodingprivate java.util.Map<java.lang.String,TychoProject>projectTypesprotected java.util.List<org.apache.maven.project.MavenProject>reactorProjectsprivate java.util.Set<java.lang.String>scopesThe scopes that the dependencies must have in order to be includedprivate org.apache.maven.execution.MavenSessionsessionprivate booleanskipTocGenSet this property to true to skip the generation of the Eclipse TOC files.private java.util.Set<java.lang.String>sourceTypesMaven module types that will be used to include the sourceprivate java.io.FiletocFileThe output location of the toc file.
This file will be overwritten.private TocOptionstocOptionsOptions for creating the toc files.private org.apache.maven.toolchain.ToolchainManagertoolchainManager
-
Constructor Summary
Constructors Constructor Description JavadocMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcleanUp()voidexecute()private org.apache.maven.project.MavenProjectfindProject(java.lang.String groupId, java.lang.String artifactId)voidsetJavadocOptions(JavadocOptions javadocOptions)voidsetScopes(java.util.Set<java.lang.String> scopes)voidsetSourceTypes(java.util.Set<java.lang.String> sourceTypes)voidsetTocOptions(TocOptions tocOptions)private voidvisitDeps(org.apache.maven.model.Dependency dep, JavadocMojo.ProjectVisitor visitor, java.util.Set<java.lang.String> scopes)private voidvisitProjects(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 outputDirectoryThe directory where the javadoc content will be generated
-
basedir
@Parameter(property="basedir", required=true, readonly=true) private java.io.File basedirThe base output directory
-
buildDirectory
@Parameter(property="project.build.directory", required=true) private java.io.File buildDirectoryThe build directory where temporary build files will be placed
-
cleanFirst
@Parameter(property="cleanFirst", defaultValue="true") private boolean cleanFirstAn 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> scopesThe 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> sourceTypesMaven 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 skipTocGenSet 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 tocFileThe 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)
-
-