maven执行package打包时,测试失败会影响打包结果。
解决方法:
方法一:修改pom.xml文件如下,把skiptests属性改为true
<project> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.20</version> <configuration> <skiptests>true</skiptests> </configuration> </plugin> </plugins> </build> </project>
方法二:通过执行如下命令
mvn install -dskiptests
或者
mvn install -dmaven.test.skip=true
方法三:idea 设置maven打包跳过test目录
如下图:build,execution,deployment>build tools >maven >runner ---->vm options
到此这篇关于maven 打包跳过test目录的实现的文章就介绍到这了,更多相关maven 打包跳过test目录内容请搜索代码网以前的文章或继续浏览下面的相关文章希望大家以后多多支持代码网!
发表评论