一、junit运行结果不影响package或者install。
maven2打包前会运行junit,但是,有时我们希望即使出现了错误,也要打包。maven2的设计者已经考虑到这种情况了。pom.xml文件配置内容如下:
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>v
本文介绍如何配置Maven项目以确保即使JUnit测试失败也能继续进行打包操作。通过在pom.xml中设置maven-surefire-plugin插件的testFailureIgnore属性为true,可以实现这一目标。
2543

被折叠的 条评论
为什么被折叠?



