【记】一次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模块成功导入

相关推荐
我叫黑大帅6 小时前
git 的 NFD 与 NFC 有什么区别?为什么我有个文件在 NFC 中间不会被当成改动,在 NFD 中就会当成改动
git·面试·github
呆萌很9 小时前
Git push 408 超时、远程断开解决办法
git
Lesile10 小时前
Hands-on Git experience
git
Co_Hui11 小时前
Git 基本使用
git
cooldream200911 小时前
AI 时代,Git 应该怎么学
人工智能·git
柒和远方13 小时前
V053: 从 Git 回退到 AI 工程治理:Vibe Coding 的 Harness 工作流与质量阀门
git·vibecoding
炸膛坦客15 小时前
Git 和 GitHub:(五)一文给出常用 Git 命令,持续更新中......
git·github
门前大桥下.16 小时前
从git创建新分支后推送数据同步新的分支
git
炸膛坦客1 天前
Git 和 GitHub:(三)基础知识与实用技巧
git·github
触底反弹1 天前
Vibe Coding 不写 Git,等于悬崖边飙车
人工智能·git·面试