Class 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
    • 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
        Example configuration:
         
         <configuration&gt;
            <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")
        Example configuration:
         <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
    • Constructor Detail

      • JavadocMojo

        public JavadocMojo()
    • 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)