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.
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>
mvn site
See the report generated:
Click on the JavaDocs link: