O'Reilly logo

Maven for Eclipse by Sanjay Shah

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Generating unit tests – HTML reports

In the preceding section, we ran the unit tests, and the results were generated in the txt and xml format. Often, developers need to generate more readable reports. Also, as a matter of fact, the reports should be a part of site documentation for better collaboration and information available in one place. To generate an HTML report and make it a part of site documentation, add the dependency under the reporting element as plugin in the pom file as follows:

<reporting>
    <plugins>
…...
<!-- For HTML test report generation -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.17</version>
      </plugin>
…...
    </plugins>
</reporting>

After the addition ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required