Maven reporting plugins do not execute if a unit test failure occurs

混江龙づ霸主 提交于 2019-12-01 07:03:30

Firstly run : mvn test OR mvn install Then, if the tests fail,please run following target to generate the reports for the test results executed above: mvn -Dmaven.test.skip=true surefire-report:report

In the link you posted:

With the latest version (2.1.2), I get a message saying that "There are some test failure," but I get no reports anywhere whether or not I specify that variable, or whether or not I specify "testFailureIgnore" in the plugin config. I got the reports fine with 2.0, but not with 2.1.2.

Do you need version 2,1 or can you work with a 2.0 version of Maven?

The error you see with 2.1.2 is because of forkmode settings which you need to perform in the plugin.

set forkmode=never and try it (I susppect there might problem in your useSystemclassloader property).

Otherwise make use of maven-surefire plugin version 2.5 which should definitel work and generate surefire rpeorts even though few test fails.

Please make use of surefire-report:report-only plugin if the reports are already generated after execution.

I had the same issue and it is due to a wrong call to the report plugin.

The correct execution of maven command is: mvn surefire-report:report

This will run the test phase by itself and if it fails it will generate the report anyway.

Check the documentation: http://maven.apache.org/surefire/maven-surefire-report-plugin/report-mojo.html

Hope this helps!! :D

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!