打包遇到错误Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test

引自:https://blog.csdn.net/xiexiangyan/article/details/107936774

遇到的问题

有一个maven项目,我clone一下最新的代码。准备打包(maven package),没想到在执行到TEST阶段报错。百思不得其解,决定跳过测试去打包,然后部署。

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project springboottest: There are test failures.

解决方式:在运行mvn install或mvn package时跳过Test。

方法1:在Terminal执行命令

mvn install -DskipTests

方法2:在Terminal执行命令

mvn install -Dmaven.test.skip=true

方法3:Spring boot项目使用

spring-boot-maven-plugin插件已经集成了maven-surefire-plugin插件,会自动运行 junit test
,只需要在pom.xml里增加如下配置:

<properties>
 	<!-- 跳过测试 -->
    <skipTests>true</skipTests>
</properties>

本文作者:碧水云天4

本文链接:https://www.cnblogs.com/smalldong/p/14264926.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   碧水云天4  阅读(10716)  评论(0编辑  收藏  举报
(评论功能已被禁用)
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
  1. 1 love songs Audio artist
  2. 2 love songs Audio artist
  3. 3 love songs Audio artist
  4. 4 love songs Audio artist
love songs - Audio artist
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.