Search code examples
mavenjunitreport

How to get a nicely formatted JUnit report out of a Maven test run?


I have:

  • a pom.xml which includes junit 4.4, log4j 1.2, and maven-surefire-plugin
  • Some Scala tests with @RunWith(classOf[JUnitRunner]) and FunSpec

To run it, I do maven clean test etc.

I can generate Surefire HTML reports with a surefire-report Maven switch, but they're not very detailed and I don't think they conform to standard JUnit reports?

Any hints on how I can get a JUnit report output with a nice format (e.g. HTML + CSS)?

Thanks.


Solution

  • The surefire-report:report and surefire-report:report-only goals will generate HTML report for Maven test execution. As part of Maven site generation it could be further styled using one of the skins