1.错误信息
There are test failures.
Please refer to D:\code\memo\memo-back\target\surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.

我在网上搜索,基本就是直接给出2个解决方案, 实际上都是一个操作,跳过test,但是没说什么原因
- 关闭
idea的maventest pom.xml插件跳过test
2.原因分析
但是我想知道什么原因,所以点开错误看了一下

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘redisSupport’: Injection of resource dependencies failed;
3.解决方案
才想起redis没有启动,所以test失败了,启动redis,然后再打包就好了
4.总结
- 好处:在自己开发测试的过程中,跳过测试会速度更快
- 坏处:测试被跳过了,可能打出来的包不能用

本文记录了一次构建项目过程中遇到的Spring Bean创建异常问题。通过分析错误信息发现是由于Redis未启动导致的测试失败,最终通过启动Redis并重新打包解决了问题。文章还探讨了跳过测试的利弊。

6104

被折叠的 条评论
为什么被折叠?



