Generating site documentation

One of the integral features of Maven is that it eases artifacts and site documentation generation. To generate site documentation, add the following dependency in the pom file:

<reporting>
    <plugins>
    <!--  Reporting -document generation -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.3</version>
      </plugin>
        <plugin>
      <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-project-info-reports-plugin</artifactId>
  <version>2.7</version>
      </plugin>
    </plugins>
    
  </reporting>

After adding the preceding dependencies, run the project with the goal as site, that is, in the Run Configurations window, specify Goals as site, as shown in following screenshot:

Generating site documentation

Click on the Run button and the documentation will be generated. The excerpts of the output in Maven Console would look like the following:

[INFO] Generating "About" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Plugin Management" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Distribution Management" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Dependency Information" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Source Repository" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Mailing Lists" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Issue Tracking" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Continuous Integration" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Project Plugins" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Project License" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Project Team" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Project Summary" report    --- maven-project-info-reports-plugin:2.7
[INFO] Generating "Dependencies" report    --- maven-project-info-reports-plugin:2.7
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

The documentation would be generated in the target/site folder and the expansion of the folder would look like the following:

Generating site documentation

There is an HTML file for each type of detail ranging from project-info, project reports, project summary, license, plugin, and so on, and index.html being the start point that links every document. The Project Summary page is shown in the following screenshot:

Generating site documentation

For more information on site and site plugins, please refer to http://maven.apache.org/guides/mini/guide-site.html and http://maven.apache.org/plugins/maven-site-plugin/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.20.231