Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on
解决错误 Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project qc-offline-report: There are test failures.
1.今天对maven项目进行打包,遇到了一个问题,一直没有解决,后来查阅资料解决了,现在记录下:
执行完clean和package后,控制台输入如下错误
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.qcsoft.qcofflinereport.QcOfflineReportApplicationTests
[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.136 s <<< FAILURE! - in com.qcsoft.qcofflinereport.QcOfflineReportApplicationTests
[ERROR] initializationError(com.qcsoft.qcofflinereport.QcOfflineReportApplicationTests) Time elapsed: 0.017 s <<< ERROR!
java.lang.Exception: The class com.qcsoft.qcofflinereport.QcOfflineReportApplicationTests is not public. [ERROR] initializationError(com.qcsoft.qcofflinereport.QcOfflineReportApplicationTests) Time elapsed: 0 s <<< ERROR!
java.lang.Exception: Test class should have exactly one public constructor [ERROR] initializationError(com.qcsoft.qcofflinereport.QcOfflineReportApplicationTests) Time elapsed: 0 s <<< ERROR!
java.lang.Exception: Method contextLoads() should be public [INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] com.qcsoft.qcofflinereport.QcOfflineReportApplicationTests.initializationError(com.qcsoft.qcofflinereport.QcOfflineReportApplicationTests)
[ERROR] Run 1: QcOfflineReportApplicationTests.initializationError » The class com.qcsoft.qc...
[ERROR] Run 2: QcOfflineReportApplicationTests.initializationError » Test class should have ...
[ERROR] Run 3: QcOfflineReportApplicationTests.initializationError » Method contextLoads() s...
[INFO]
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.250 s
[INFO] Finished at: 2020-03-30T16:11:20+08:00
[INFO] Final Memory: 28M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project qc-offline-report: There are test failures.
[ERROR]
[ERROR] Please refer to D:\fzh\qc-offline-report\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
2.解决方案:在原来的maven依赖插件中新加一个maven-surefire-plugin依赖即可
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
加了之后的pom.xml
<build>
<finalName>qc-offline-report</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on的更多相关文章
- maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang
maven打包成war时,报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default- ...
- Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-kms: An Ant BuildException has occured
编译cdh版hadoop2.5.0出现的问题 系统: CentOs66 64位 JDK:1.7 Maven: 3.0.5 Protobuf: libprotoc 2.5.0 编译命令: mvn pac ...
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project LogTest: Compilation failure -> [Help 1]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default ...
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:
security-sdk-1.0.jar已经存在于D:/secServerSDK-test/src/main/resources/lib下 报错如下: xxxxxx@xxxxxxxx /d/secSe ...
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of 3: mojo org.apache.maven.plugins:
问题: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (defau ...
- [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on ...
- maven install 报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project*****
[ERROR]Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-co ...
- Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log
I'm trying to run simple struts project using maven and tomcat. When I'm trying to exucute next goal ...
- 解决Failed to execute goal org.apache.maven.plugins
1.Maven构建失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3 . 2 :compile ...
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile 解决办法
Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (d ...
随机推荐
- MacOS如何使用语音输入
Siri是Apple旗下强大的语音助手,而Siri的语音输入是必不可少的的存在.目前的MacOS中都有语音听写功能,可以让它把我们的语音转化成为文字.如果你此时不想打字,或是不方便打字的情况下,这个功 ...
- CSS3-animation实现走马灯效果
动画animation 1.先定义动画: @keyframes 动画名称( from{} to{} ) 或者 @keyframes 动画名称( 0%{} 50%{} 100%{} ) 百分号指的是动画 ...
- 你不知道的JavaScript--作用域
用简单的代码 展示代码的魅力 1.在浏览器里,在全局范围内,this等价于windo ...
- 在VUE里实现一个简单的中国地图
如何在vue里面实现一个简单的中国地图,并且实现一些简单的个性化修改. 下面是最终实现的效果图.透明的地图加一个背景图. 1.在你的项目里安装echarts的依赖 npm install echart ...
- 百度地图api高亮显示指定区域,其余遮罩
先放一张最后的效果图 主要功能:只显示天府新区(双流区+龙泉驿区)这一块,其他的地方就用半透明的遮罩层盖住,然后用Markers标注出每个项目的所在地点,当鼠标悬浮在标注点的时候就显示出项目名称. h ...
- 2022-07-09 第一小组 张明旭 前端HTML学习记录
今天是正式学习的第一天,第一次接触前端内容,蒙了一圈又一圈,老师讲课速度是1000圈/s!!!!!!(插一句老师的打字和打代码速度起飞!) 好在有视频回放而且跟了笔记,能复习n遍.加油!!! 主要学习 ...
- HDFS、Ceph、GFS、GPFS、Swift、Lustre……容器云选择哪种分布式存储更好?
HDFS.Ceph.GFS.GPFS.Swift.Lustre--容器云选择哪种分布式存储更好?-51CTO.COM 容器云在使用分布式存储时,HDFS.CEPH.GFS.GPFS.Swift等分布式 ...
- 不可错过的JS代码优化技巧(持续更新)
1. 带有多个条件的 if 语句 把多个值放在一个数组中,然后调用数组的 includes 方法. //longhand if (x === 'abc' || x === 'def' || x === ...
- scala中变量常量字符串使用
1.注释 scala注释使用与java完全一样: 2.变量和常量 (1).常量:在程序执行中,其值不会改变的变量: 基本语法:var 变量名称:变量类型 = 变量初始值 var num1:Int = ...
- 【APT】Bitter APT组织针对巴基斯坦航空综合部门攻击活动分析
前言 蔓灵花(Bitter)是一个被广泛认为来自印度的APT组织,该组织长期针对我国及巴基斯坦的政府.军工.电力.核等部门发动网络攻击,窃取敏感数据,具有较强的政治背景.本次分享一个蔓灵花组织针对巴基 ...