Generating selective reports

We have seen that by default the site command generates some Project Information. Some of it, for instance Mailing Lists, may be nonexistent or irrelevant to the project. Let us see how we can avoid generating these. The Maven Project Info Reports plugin is the plugin that provides the standard reports from pom. It can be configured to exclude specific reports.

How to do it...

Use the following steps to generate selective site report:

  1. Open the project for which you want to generate the site report.
  2. Add the following code to the reporting section of the pom.xml file:
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.7</version>
        <reportSets>
          <reportSet>
            <reports>
              <report>dependencies</report>
              <report>project-team</report>
              <report>license</report>
              <report>scm</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
  3. Run the following Maven site command:
    mvn test site
    
  4. Open the generated report:
    How to do it...

How it works...

We explicitly specified the reports that we wanted to see in Project Information. Due to this, only those reports are generated and displayed.

This allows us to avoid generating and displaying reports that are not applicable to the project.

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

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