Maven Javadoc Plugin-Generate HTML javadoc

Maven Javadoc Plugin uses the Javadoc tool to generate javadocs for the specified project. This tutorial show you how to Generate HTML JavaDoc in your build using maven. The Javadoc Plugin gets the parameter values that will be used from the plugin configuration specified in the pom. To hold all javadoc arguments, packages or files, the Javadoc Plugin generates argument files and calls the Javadoc located in $JDK_HOME/bin/ directory.

Let’s begin:

Before generating javadoc using maven javadoc plugin, we will create a maven project following the steps below:

Project directory structure

The project directory structure should be like this

Maven Javadoc Plugin - Generate HTML javadoc

Maven dependency
This project are using hibernate and mysql dependency and here is our pom.xml

Let’s dig deeper:

We are using Maven Javadoc Plugin to generate HTML JavaDoc so that we have this plugin in pom.xml file.

We are using Maven Project Info Reports plugin to generate reports information about the project so that this plugin must be added in pom.xml file

Create Model
We create a simple POJO class named Student which be mapped to STUDENT table in database.

Create Hibernate Utility class
For configuring hibernate on startup and managing session factory we create the HibernateUtil class like this:

Create a program to perform CRUD operations on Database
Now we create Hibernate Hello World Example in Eclipse like below

Generate HTML JavaDoc using Maven Javadoc Plugin
Now, we are using Maven Javadoc Plugin to build the reports with command below

Output in console
Maven Javadoc Plugin - Generate HTML javadoc

Project Information Output
Maven Javadoc Plugin - Generate HTML javadoc

Html JavaDoc
Maven Javadoc Plugin - Generate HTML javadoc

That’s it on the tutorial Maven Javadoc Plugin – Generate HTML javadoc
References
Apache Maven Documentation

Download complete source code, click link below

HibernateMavenJavaDocExample.zip (25 downloads)

Leave a Comment

*

Please share it if you found this useful
Hide Buttons