Maven JavaDoc Plugin

The Maven JavaDoc Plugin uses the Javadoc tool to generate javadocs for the specified project.

Goals:

  • javadoc:javadoc generates the Javadoc files for the project. It executes the standard Javadoc tool and supports the parameters used by the tool.
  • javadoc:jar creates an archive file of the generated Javadocs. It is used during the release process to create the Javadoc artifact for the project’s release.
  • javadoc:fix is an interactive goal which fixes the Javadoc documentation and tags for the Java files.
  • javadoc:aggregate-jar creates an archive file of the generated Javadocs for an aggregator project.

Configuration:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                    <phase>install</phase>
                    <configuration>
                        <failOnError>false</failOnError>
                        <doclint>none</doclint>
                        <javadocExecutable>C:\Program Files\Java\jdk1.8.0\bin\javadoc.exe</javadocExecutable>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Run the following maven command:

mvn install

Output:

Loading source file C:/projects/HelloWorldApplication/src/main/java/HelloWorld.java...
Constructing Javadoc information...
Standard Doclet version 1.8.0
Building tree for all the packages and classes...
Generating C:\projects\HelloWorldApplication\target\apidocs\HelloWorld.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\package-frame.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\package-summary.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\package-tree.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\constant-values.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\class-use\HelloWorld.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\package-use.html...
Building index for all the packages and classes...
Generating C:\projects\HelloWorldApplication\target\apidocs\overview-tree.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\index-all.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\deprecated-list.html...
Building index for all classes...
Generating C:\projects\HelloWorldApplication\target\apidocs\allclasses-frame.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\allclasses-noframe.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\index.html...
Generating C:\projects\HelloWorldApplication\target\apidocs\help-doc.html...
[INFO] Building jar: C:\projects\HelloWorldApplication\target\HelloWorld-1.0-SNAPSHOT-javadoc.jar

Sample JavaDoc HTML Page:

 

Share

Bijan Patel

Founder & Creator of QAScript | 12+ years of IT Experience | Full Stack Automation Engineer | Blogger | Trainer

You may also like...

2 Responses

  1. Stremove.com says:

    If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven .

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!