如果发生单元测试失败,则不会执行Maven报告插件 [英] Maven reporting plugins do not execute if a unit test failure occurs

查看:208
本文介绍了如果发生单元测试失败,则不会执行Maven报告插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果单元测试失败,则Maven报告部分中的所有插件均不会执行.

None of the plugins in the reporting section of Maven execute if there is a unit test failure.

我发现可以在此处设置maven.test.failure.ignore = true- http://jira.codehaus.org/browse/SUREFIRE-247 这种方法的问题在于,即使存在单元测试失败,我们的哈德逊主义建筑还是成功的.

I found that I can set maven.test.failure.ignore=true here - http://jira.codehaus.org/browse/SUREFIRE-247 The problem to this approach is now our hudson builds are successful even if there are unit test failures.

我真正想做的是将报告插件maven-surefire-report-plugin设置为与构建插件一起运行,但是我无法正常工作.

What I would really like to do is set the reporting plugin maven-surefire-report-plugin to run with the build plugins on a phase but I can't get this to work.

关于发生单元测试失败时如何使Maven报告插件执行的任何想法?

Any idea on how to get the Maven reporting plugins to execute if a unit test failure occurs?

推荐答案

首先运行:mvn test或mvn install然后,如果测试失败,请运行以下目标为上面执行的测试结果生成报告:mvn -Dmaven .test.skip = true surefire-report:report

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

这篇关于如果发生单元测试失败,则不会执行Maven报告插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆