【记】一次common模块导入无效的bug

首先Maven clean install无用

然后idea清除缓存重启无用

pom.xml文件重载无效

正确解决路径:

1.检查common模块的父工程导入和自身模块的声明是否正确

默认是继承父工程的groupid,可以不用再声明

2.检查子工程是否引入正确的common,org不要写成ogr了

3.修改完所有的common模块相关声明然后父工程clean报version缺失错误

ERROR The project org.mumu:comsumer:1.0 (D:\学习\javacode\eureka\consumer\pom.xml) has 6 errors ERROR 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-web:jar is missing. @ line 23, column 21 ERROR 'dependencies.dependency.version' for org.springframework.boot:spring-boot-starter-actuator:jar is missing. @ line 27, column 21 ERROR 'dependencies.dependency.version' for org.springframework.boot:spring-boot-devtools:jar is missing. @ line 31, column 21

如果是父工程管理了版本那么子工程是可以不用声明version的,此时去检查父工程的pom

检查子模块、groupid等信息

检查properties是否正常,不能爆红,复制粘贴注意只能有一个properties

检查版本管理,注意这里是dependencyManagement、dependencies、dependency三个标签

至此重新clean install,common模块成功导入

相关推荐
我登哥MVP1 小时前
Spring Boot 从“会用”到“精通”:自动装配原理
java·spring boot·后端·spring·tomcat·maven·intellij-idea
雪的季节1 小时前
团队 Git 协作完整教程(企业级标准流程)
git
czhc11400756632 小时前
6.4:git
git
Rain5092 小时前
实战:搭建 AI Code Review 自动化流水线
前端·人工智能·git·ci/cd·自动化·ai编程·代码复审
zzzzzz3102 小时前
GitHub 今日爆火!headroom:一个帮你省 60-95% Token 的 AI Agent 上下文压缩神器
git·机器学习·github
Al leng3 小时前
注释旧依赖仍残留旧Jar四大原因+分步解决(IDEA+Maven)
java·maven·intellij-idea·jar
兔老大RabbitMQ3 小时前
IDEA 打字打在光标右边 / 删除异常问题
java·ide·intellij-idea
初圣魔门首席弟子4 小时前
bug【已解决】腾讯 WorkBuddy 无法访问:校园网限制导致的网络问题排查全记录
bug
张小凡vip4 小时前
gitlab的ci配置文件yaml参数说明
git·ci/cd·gitlab
搬砖的前端4 小时前
AI工具集:Git提交时使用AI进行CodeReview如何在前端应用构建NPM包
前端·人工智能·git·npm·codeview