Generating Javadocs for a site
Documentation for Java projects is created using Javadocs. Maven provides support not only to generate Javadocs, but also to publish them as part of the site. Plugins configured within the reporting
element will generate content for the site. When they are configured within the build
element, they can generate reports independent of site.
How to do it...
Use the following steps to generate Javadocs for a site:
Open the Maven project
project-with-documentation
.Add the following section in the
pom.xml
file:<reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.10.1</version> </plugin> </plugins> </reporting>
Run the following command:
mvn site
See the report generated:
Click on the JavaDocs link:
How it works...
We added the Javadoc plugin to the reporting
section of pom
. When the Site plugin...