Maven - Maven Javadoc | Generating Javadocs in maven - maven tutorial
What is Javadocs in Maven?
- Javadoc is a documentation tool which defines a standard format for such comments, and which can generate HTML files to view the documentation from a web broswer.
- Maven comes out with one of the cool features which does the generation of the javadocs for a project.
- As every developer knows that it is vital to have the code documentation of our project and this feature of maven helps to accomplish the same.
- Maven uses the maven-javadoc plugin to generate the javadocs of a project.
- This plugin internally uses JDK\bin\javadoce.exe command to generate javadocs.
- When the project is deployed using mvn install command, it generates the javadocs for the project.
maven tutorial tags : apache maven , maven repository , maven central
Configuring Javadocs Plugin
- The javadoc plugin can be configure for any project in pom.xml as shown below:
pom.xml
Generating Javadocs
- After adding the above mentioned plugin in your project's pom.xml, all you have to do is, open the command prompt, go to the project directory,
- For eg. D:\Java\workspace\JavaSamples and run the command maven install.
- The generated javadocs can be found in the project's location: D:\Java\workspace\JavaSamples\target\apidocs.