在使用maven使用package打包的时候有时候会出现如下错误:

There are test failures.
Please refer to XXX/target/surefire-reports for the individual test results

这个表示测试失败导致的打包失败,解决方法就是跳过test打包。

1.命令行形式(万能)

命令1:mvn package -Dmaven.test.skip=true

命令2:mvn package -DskipTests

命令3:mvn package -Dmaven.test.failure.ignore=true
以上均均可,但有一定的区别
命令1:不执行测试用例,也不会编译测试用例
命令2:不执行测试用例,会编译测试用例(如果编译也报错那么么就使用命令1)
命令3:忽略test的错误就算是失败了也继续构建

2.配置pom文件的形式

2.1. 添加plugin(引入的时候爆红,不碍事)

方法1:相当于命令3

        <plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><configuration><testFailureIgnore>true</testFailureIgnore></configuration></plugin></plugins>

方法2:相当于命令2

       <plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><configuration><skipTests>true</skipTests></configuration></plugin></plugins>

2.2 配置SpringBoot的形式

方法1:不会编译测试类,同命令1

    <properties><maven.test.skip>true</maven.test.skip></properties>

方法2:会编译测试类,同命令2

    <properties><skipTests>true</skipTests></properties>

3.利用idea的形式

点击这个闪电标志,然后发现test被划掉了,再点击packge就可以了

先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦

maven打包报错:Please refer to XXXtargetsurefire-reports for the individual test results. 以及跳过test打包相关推荐

  1. pyinstaller打包报错 Failed to execute script ‘xxx‘ due to unhandled exception:input():lost sys.stdin

    pyinstaller打包报错 Failed to execute script 'xxx' due to unhandled exception:input():lost sys.stdin pyi ...

  2. maven 打包报错 surefire-reports for the individual test results.

    Eclipse Maven打包报错 [ERROR] [ERROR] Please refer to D:\File\workspace\izh-common-util\target\surefire- ...

  3. Maven 新版本 3.8.1 打包报错 maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories

    Maven 新版本 3.8.1 打包报错 maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories [ ...

  4. maven打包报错You have to use a classifier to attach supplemental artifacts to the project instead of rep

    maven打包报错You have to use a classifier to attach supplemental artifacts to the project instead of rep ...

  5. maven打包报错找不到符号,由于找不到类中方法的解决思路

    maven打包报错找不到符号,若pom文件引用正常,报错的类有修改能正常启动执行程序,很有可能因为该类属于公共工具类,在外层目录,通过pom引用的,修改后工具类后,打包时没有将其重新打包,导致该出引用 ...

  6. maven打包报错Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.6.1:cle

    问题记录: maven打包报错Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.6.1:cle 解决办法: 这个 ...

  7. idea 打包报错 Could not find artifact com.ruoyi:ruoyi-framework:pom:4.6.1 in public (http://maven.aliyun

    在IDEA 的 setting→Build,Execution,Deployment→Build Tools→Maven→Runner下 找到VM Options: 添加以下代码 -Dmaven.wa ...

  8. 【jenkins打包maven项目报错记录】

    jenkins打包maven项目报错记录 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3 ...

  9. idea编译报错:Refer to the generated Javadoc files in ‘..targetapidocs‘ dir. 解决

    idea编译报错:Refer to the generated Javadoc files in '-\target\apidocs' dir. 解决 错误信息 Failed to execute g ...

最新文章

  1. 【宽搜】XMU 1039 Treausure
  2. ssh遇到port 22:No route to host问题的解决方法
  3. 用python画烟花-用python做一个烟花show
  4. [python] 使用scikit-learn工具计算文本TF-IDF值
  5. java轻功游戏,会轻功又可以飞的游戏(3d大型游戏)
  6. 什么笔记本电脑好用_苹果笔记本好用吗?苹果笔记本怎么样?
  7. Linux常出现的面试试题
  8. Dangling meta character '?' near index 0
  9. Hive 内部表外部表
  10. C++14::lambda函数的类型
  11. C 不使用其他库生成BMP图片
  12. Spring+Stomp+ActiveMq实现websocket长连接
  13. Python实现Eternal Night游戏(尚未完结,不断更新)
  14. android之标准体重
  15. springcloud如何制作一个物联网产品
  16. anyRTC 重磅推出在线实时 K 歌解决方案
  17. 约瑟夫环!编 号是1,2,??,n的n个人按照顺时针方向围坐一圈,每个人只有一个密码(正整数)。一开始任选一个正整数作为报数上限值m,从第一个仍开始顺时针方向 自1开始顺序报数,报到m时停止报数。
  18. 在线选毕业照片相册系统开发
  19. python计算导数_python计算导数并绘图的实例
  20. 2016淘宝首页改版 细说淘宝首页设计变化史

热门文章

  1. 亚马逊计划在中国推出Kindle
  2. 2019 ICCV best paper:sinGAN: Learning a Generative Model from a Single Natural Image解读
  3. Android模拟器Genymotion安装向导
  4. java emr_java – EMR – 在Hadoop(和YARN)中使用自定义日志记录appender
  5. 数字化转型有必要吗?
  6. “2020中小企业产融结合高峰论坛”在京隆重举行
  7. canvas意料之外获得降龙十八掌的效果
  8. MotionBuilder与NOKOV度量动捕系统连接教程
  9. 导轨式安装智能多户电表的价格
  10. 文件传输校验-crc32校验算法