rip*_*234 234 java maven-2 surefire
我有一个包含几个模块的项目.当所有测试通过后,Maven测试将全部运行.
当第一个模块中的测试失败时,maven将不会继续下一个项目.我在Surefire设置中将testFailureIgnore设置为true,但它没有帮助.
如何让maven运行所有测试?
des*_*pot 334
从文档:
-fae
,之后--fail-at-end
才失败; 允许所有未受影响的构建继续
-fn
,无论项目结果如何,都--fail-never
不会失败
因此,如果您正在测试一个模块而不是您正在使用的模块-fae
.
否则,如果您有多个模块,并且您希望所有mvn clean install -fn
模块都经过测试(即使是依赖于失败的测试模块的模块),您也应该运行.
-fae
将继续使用具有失败测试的模块(将运行所有其他测试),但将跳过依赖于它的所有模块.
rip*_*234 92
我刚刚找到了"-fae"参数,它导致Maven运行所有测试而不是在失败时停止.
Pas*_*ent 78
你可以用surefire 2.6进行测试,并配置surefire testFailureIgnore=true
.或者在命令行上:
mvn install -Dmaven.test.failure.ignore=true
Run Code Online (Sandbox Code Playgroud)
nyb*_*bon 32
尝试在root项目的pom.xml中为surefire插件添加以下配置:
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
Run Code Online (Sandbox Code Playgroud)