Maven - Project Documents



This tutorial will teach you how to create documentation of the application in one go. So let's start, go to C:/MVN directory where you had created your java consumerBanking application using the examples given in the previous chapters. Open consumerBanking folder and execute the following mvn command.

Update pom.xml for Documentation Creation

Update, the pom.xml in D:\Projects\MVN\consumerBanking folder as shown below.

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.companyname.bank</groupId>
   <artifactId>consumerBanking</artifactId>
   <packaging>jar</packaging>
   <version>1.0-SNAPSHOT</version>
   <name>consumerBanking</name>
   <url>http://maven.apache.org</url>
   <properties>
      <maven.compiler.source>24</maven.compiler.source>
      <maven.compiler.target>24</maven.compiler.target>
   </properties>
   <build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.7</version>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.9</version>
         </plugin>
      </plugins>
   </build>
   <dependencies>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>3.8.1</version>
         <scope>test</scope>
      </dependency>
   </dependencies>
</project>
D:\Projects\MVN\consumerBanking>mvn site

Maven will start building the project.

[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< com.companyname.bank:consumerBanking >----------------
[INFO] Building consumerBanking 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- site:3.12.1:site (default-site) @ consumerBanking ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:3.9.0
[INFO] 15 reports detected for maven-project-info-reports-plugin:3.9.0: ci-management, dependencies, dependency-info, dependency-management, distribution-management, index, issue-management, licenses, mailing-lists, modules, plugin-management, plugins, scm, summary, team
[INFO] Rendering site with default locale English (en)
[INFO] Relativizing decoration links with respect to localized project URL: http://maven.apache.org
[INFO] Rendering content with org.apache.maven.skins:maven-default-skin:jar:1.3 skin.
[INFO] Generating "Dependencies" report  --- maven-project-info-reports-plugin:3.9.0:dependencies
[INFO] Generating "Maven Coordinates" report --- maven-project-info-reports-plugin:3.9.0:dependency-info
[INFO] Generating "About" report         --- maven-project-info-reports-plugin:3.9.0:index
[INFO] Generating "Plugin Management" report --- maven-project-info-reports-plugin:3.9.0:plugin-management
[INFO] Generating "Plugins" report       --- maven-project-info-reports-plugin:3.9.0:plugins
[INFO] Generating "Summary" report       --- maven-project-info-reports-plugin:3.9.0:summary
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.414 s
[INFO] Finished at: 2025-09-15T12:52:25+05:30
[INFO] ------------------------------------------------------------------------

Your project documentation is now ready. Maven has created a site within the target directory.

documentation site pages

Open D:\Projects\MVN\consumerBanking\target\site folder. Click on index.html to see the documentation.

consumer web page

Maven creates the documentation using a documentation-processing engine called Doxia which reads multiple source formats into a common document model. To write documentation for your project, you can write your content in a following few commonly used formats which are parsed by Doxia.

Format Name Description Reference
XDoc A Maven 1.x documentation format

https://jakarta.apache.org/site

FML Used for FAQ documents

https://maven.apache.org

Advertisements