我发现 surefire-report
插件非常不适合我的工作方式。我一直在清理项目,我不想每次想在浏览器中查看测试报告时都花费 5 分钟来重建整个站点。
如果我输入 mvn surefire-report:report-only
,生成的报告太难看,几乎不可读。
我正在寻找类似 ant 的 JUnitReport 任务。是否已经有一个可用的?
最佳答案
这就是我的工作:
# 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
转到 target/site/surefire-report.html 以获取报告。
测试运行后,其余两个对我来说大约在 3.5 秒内运行。
希望对您有所帮助。享受吧!
关于java - Maven 有没有像样的 HTML Junit 报告插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2846493/