Maven执行install时报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test

本文讲述了作者在项目开发中遇到的Maven测试问题,通过检查测试类方法和添加测试用例解决,提供了解决步骤和关键技巧。

今天接着昨天做项目对进度做时,发现执行mvn install无法成功
总是会报如下的错误:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.698 s
[INFO] Finished at: 2020-11-15T16:58:47+08:00
[INFO] Final Memory: 11M/217M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project CRMSystem: There are test failures.
[ERROR] 
[ERROR] Please refer to G:\Language Proctice\java\pro\20201109\CRMSystem\target\surefire-reports for the individual test results.
[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.


有些纳闷,网上查了一下资料也无果

不过好在最后终于解决了问题,解决方案如下:

1.检查test包下是否有测试类没有方法
2.若有这种情况,在当前测试类中加上一个方法,并使用@Test注解

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值