Maven Surefire Report

By default, maven-surefire-plugin generates the XML resulting from a test suite execution as ${basedir}/target/surefire-reports/TEST-*.xml. This XML output can be easily parsed to HTML using the plugin maven-surefire-report-plugin. To that, we simply need to declare this plugin in the reporting clause of our pom.xml, as follows:

<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${maven-surefire-report-plugin.version}</version>
</plugin>
</plugins>
</reporting>

This way, when we invoque the Maven lifecycle for documentation (mvn site), an HTML page with the test result will be included in the general report.

See an example of the report, made using the project junit5-reporting within the GitHub repository examples (https://github.com/bonigarcia/mastering-junit5):

HTML report generated by maven-surefire-report-plugin
..................Content has been hidden....................

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