maven 微服务实战中各种问题汇总 一片搞定(持续更新中。。。)
1、测试类报错
1.1)报错内容:Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 6.244 s <<< FAILURE! - in com.ctra.gulimall.gateway.GulimallGatewayApplicationTests contextLoads Time elapsed: 0.002 s <<< ERROR!
1.2)图片如下
解决方案
哪个微服务报错,就删除哪个微服务的test测试类的文件
解决方案地址:https://blog.****.net/zovee/article/details/106738384
2、maven 没有root
2.1)问题描述:一般在mac的idea中创建的父子项目,会没有根root的maven
2.2)图片如下
解决方案
1、先在父项目中新建一个pom
2、在maven中加入父项目中的pom
解决方案:https://blog.****.net/corleone_4ever/article/details/105239253
3、maven 多个 root
3.1)问题描述:在maven中看到有多个root问题
3.2)图片如下(2个root)
解决方案
1、先在父pom中将子pom聚合进来