如果集成测试失败,则在Maven中跳过构建失败 [英] Skip Build failure in maven if the integration test fails
问题描述
即使集成测试失败,我也想跳过构建失败.我正在使用maven-failsafe进行集成测试.我目前得到以下信息:
I want to skip the build failure even if the integration test fails. I am using maven-failsafe for Integration test. I am currently getting the following:
Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.15:verify (default) on project xxxxx: There are test failures.
问题:我可以对Maven故障安全插件使用以下内容吗?我知道它适用于Surefire插件,但不确定是否有故障保险.
Question: Can I use the following for Maven Failsafe Plugin? I know it works for the Surefire plugin, but not sure for failsafe.
-Dmaven.test.failure.ignore=true
推荐答案
是的,相同的参数对maven-failsafe-plugin
有效.从 verify
目标的文档中可以将 testFailureIgnore
设置为
Yes, the same parameter is valid for the maven-failsafe-plugin
. From the documentation of the verify
goal, you can set the testFailureIgnore
to true
:
将此值设置为true可忽略测试期间的失败.不建议使用它,但有时很方便.
Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.
- 类型:
boolean
- 必填:否
- 用户属性:
maven.test.failure.ignore
- 默认值:
false
- Type:
boolean
- Required: No
- User Property:
maven.test.failure.ignore
- Default:
false
对应的用户属性为maven.test.failure.ignore
,这意味着在命令行上设置该属性将忽略测试失败.
The corresponding user property is maven.test.failure.ignore
, which means that setting that property on the command line will ignore tests failure.
这篇关于如果集成测试失败,则在Maven中跳过构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!