Learn How To Create Project Documents Using Maven

0
160
Project Documents Using Maven

In the earlier articles, we discussed about handling external dependencies in Maven and its different types of Maven repositories through which the actual dependency management is taken care by Maven. However, in this article, we are going to discuss the creation of project documents using Maven. We are going to take an existing Maven project (springframework.myfirstapp) as example for the creation of project documentation. We have to navigate to the project directory using command line where pom.xml file is located (here C:\work\project\springframework.myfirstapp) and issue ‘mvn site’ command. If there is a requirement of Maven plugins and JARS for creating the document and if they were not downloaded earlier then you will observe those artifacts to get automatically downloaded after issue of ‘mvn site’ command at this point of time on the command line.

Maven Command to generate Project Document

Sample project pom.xml file

When you issue ‘mvn site’ command at the project path with above pom.xml file then Maven will initate building the project and the following logs will be observed.

Results

Once maven build is successful then you can observe that a new site directory has created within the target directory which contains the project documentation as shown below.
Site Directory
Viewing Project document

You can view Maven Project documents by navigating to C:\work\project\springframework.myfirstapp\target\site folder and clicking on the index.html file in order to see the project documentation as shown below.
SpringFramework-firstapp
Next, click on the ‘Summary’ link present on the left hand side of the screen to find the overall project summary as shown below.
project summary

Source Code for this Spring Framework – App

Doxia – Documentation-processing Engine

Doxia is a documentation-processing engine which is used by Maven to create project documentation. It reads multiple source formats and covert it into a common document model. There are two commonly used formats which are available to Maven for writing project documentation. The formats which are parsed by Doxia are as follows.

Name of Format

Description

Link

XDocXDoc is a Maven 1.x documentation format and used to create regular project documents.https://jakarta.apache.org/site
FMLFML is used for FAQ documents creation.https://maven.apache.org

Conclusion: –
In this article, we discussed about the creation of the project documentation by using Maven along with a suitable project example.

LEAVE A REPLY

Please enter your comment!
Please enter your name here