maven中如何忽略单元测试中的错误继续构建工程(转)
文章出自:http://blog.csdn.net/symgdwyh/article/details/4288972
maven中默认的情况下如果单元测试有错误,将会停止构建工程,如果想忽略错误而继续构建的话只需在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>
或者
<project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip>true</skip> </configuration> </plugin> </plugins> </build> [...] </project>
这段配置将会忽略单元测试的错误而继续构建。
命令行:$ mvn test -Dmaven.test.failure.ignore=true
相关推荐
蛰脚踝的天蝎 2020-11-10
Cocolada 2020-11-12
TuxedoLinux 2020-09-11
snowphy 2020-08-19
83540690 2020-08-16
lustdevil 2020-08-03
83417807 2020-07-19
张文倩数据库学生 2020-07-19
bobljm 2020-07-07
83417807 2020-06-28
86427019 2020-06-28
86427019 2020-06-25
zhengzf0 2020-06-21
tobecrazy 2020-06-16
宿命java 2020-06-15
83417807 2020-06-15
84284855 2020-06-11