Is there a decent HTML Junit report plugin for Maven?

Y.H Wong picture Y.H Wong · May 17, 2010 · Viewed 46.6k times · Source

I find the surefire-report plug-in very unsuitable to my working style. I clean the project all the time and I don't want to spend 5 min to rebuild the whole site every time I want to look at the test report in my browser.

If I type mvn surefire-report:report-only, the generated report is too ugly and barely readable.

What I'm looking for is something like ant's JUnitReport task. Is there one available out there already?

Answer

prasanna picture prasanna · May 30, 2014

This is what I do:

# Run tests and generate .xml reports
mvn test

# Convert .xml reports into .html report, but without the CSS or images
mvn surefire-report:report-only

# Put the CSS and images where they need to be without the rest of the
# time-consuming stuff
mvn site -DgenerateReports=false

go to target/site/surefire-report.html for the report.

After tests run, the rest of the two run in about 3.5 seconds for me.

Hope that helps. Enjoy!