YouTip LogoYouTip

Maven Project Documents

In this chapter, we will mainly learn how to create Maven project documentation. For example, if we have created a `consumerBanking` project in the `C:/MVN` directory, Maven uses the following command to quickly create a Java project: ```bash mvn archetype:generate -DgroupId=com.companyname.bank -DartifactId=consumerBanking -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false Modify the `pom.xml` file and add the following configuration (if it's not already there): ```xml ... org.apache.maven.plugins maven-site-plugin 3.3 org.apache.maven.plugins maven-project-info-reports-plugin 2.7 ... > Otherwise, when running the `mvn site` command, you might encounter the **java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent** issue. This is due to an outdated version of the `maven-site-plugin`. Upgrading to version 3.3 or higher will resolve it. Open the `consumerBanking` folder and execute the following `mvn` command. ```bash C:MVNconsumerBanking> mvn site Maven will start generating the documentation: Scanning for projects... ------------------------------------------------------------------- Building consumerBanking task-segment: ------------------------------------------------------------------- [site:site {execution: default-site}] artifact org.apache.maven.skins:maven-default-skin: checking for updates from central Generating "About" report. Generating "Issue Tracking" report. Generating "Project Team" report. Generating "Dependencies" report. Generating "Continuous Integration" report. Generating "Source Repository" report. Generating "Project License" report. Generating "Mailing Lists" report. Generating "Plugin Management" report. Generating "Project Summary" report. ------------------------------------------------------------------- BUILD SUCCESSFUL ------------------------------------------------------------------- Total time: 16 seconds Finished at: Wed Jul 11 18:11:18 IST 2012 Final Memory: 23M/148M ------------------------------------------------------------------- !(#) Open the **C:MVNconsumerBankingtargetsite** folder. Click on **index.html** to view the documentation. !(#) Maven uses a documentation processing engine called (http://maven.apache.org/doxia/index.html) to create documentation. It can read source code in various formats into a common document model. To write documentation for your project, you can write the content in one of the following common formats that Doxia can convert. | Format Name | Description | Reference | | --- | --- | --- | | Apt | Plain text document format | [http://maven.apache.org/doxia/references/apt-format.html](http://maven.apache.org/doxia/references/apt-format.html) | | Xdoc | A documentation format from Maven 1.x | [http://jakarta.apache.org/site/jakarta-site2.html](http://jakarta.apache.org/site/jakarta-site2.html) | | FML | Suitable for FAQ documents | [http://maven.apache.org/doxia/references/fml-format.html](http://maven.apache.org/doxia/references/fml-format.html) | | XHTML | Extensible HTML documents | [http://en.wikipedia.org/wiki/XHTML](https://en.wikipedia.org/wiki/XHTML) |
← Maven Build AutomationMaven External Dependencies β†’