'dependencies.dependency.version' is missing for xxx

本文详细解析了Maven项目构建中常见的错误,如'dependencies.dependency.version'缺失等,并提供了有效的解决方案,包括清理本地仓库和重新导入项目。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

先说结论:

在遇到maven问题时,比如'dependencies.dependency.version' is missing或者pom.xml文件报错(语法没错)或者无法下载相应的jar包时,请记得清空local repository里的包,在重新Reimport

今天遇到一个比较奇怪的问题,代码下载好之后类报错,提示需要添加依赖,确定相关依赖是没有问题的,比较大的开源项目,在项目路径下执行mvn clean,报错如下

E:\work\sources\RuoYi>mvn clean
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-comp
iler-plugin is missing. @ line 96, column 21
[ERROR] 'modelVersion' is missing. @ [unknown-group-id]:[unknown-artifact-id]:[u
nknown-version], C:\Users\Administrator\.m2\repository\org\springframework\boot\
spring-boot-dependencies\2.1.1.RELEASE\spring-boot-dependencies-2.1.1.RELEASE.po
m, line 2, column 7
[ERROR] 'groupId' is missing. @ [unknown-group-id]:[unknown-artifact-id]:[unknow
n-version], C:\Users\Administrator\.m2\repository\org\springframework\boot\sprin
g-boot-dependencies\2.1.1.RELEASE\spring-boot-dependencies-2.1.1.RELEASE.pom, li
ne 2, column 7
[ERROR] 'artifactId' is missing. @ [unknown-group-id]:[unknown-artifact-id]:[unk
nown-version], C:\Users\Administrator\.m2\repository\org\springframework\boot\sp
ring-boot-dependencies\2.1.1.RELEASE\spring-boot-dependencies-2.1.1.RELEASE.pom,
 line 2, column 7
[ERROR] 'version' is missing. @ [unknown-group-id]:[unknown-artifact-id]:[unknow
n-version], C:\Users\Administrator\.m2\repository\org\springframework\boot\sprin
g-boot-dependencies\2.1.1.RELEASE\spring-boot-dependencies-2.1.1.RELEASE.pom, li
ne 2, column 7
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-context
-support:jar is missing. @ line 57, column 15
[ERROR] 'dependencies.dependency.version' for org.springframework:spring-web:jar
 is missing. @ line 63, column 15
[ERROR] 'dependencies.dependency.version' for mysql:mysql-connector-java:jar is
missing. @ line 76, column 21
[ERROR] 'dependencies.dependency.version' for javax.servlet:javax.servlet-api:ja
r is missing. @ line 81, column 20
[ERROR] 'dependencies.dependency.version' for org.slf4j:slf4j-api:jar is missing
. @ line 87, column 15
 @
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.ruoyi:ruoyi:3.2 (E:\work\sources\RuoYi\pom.xml) has 9
errors
[ERROR]     'modelVersion' is missing. @ [unknown-group-id]:[unknown-artifact-id
]:[unknown-version], C:\Users\Administrator\.m2\repository\org\springframework\b
oot\spring-boot-dependencies\2.1.1.RELEASE\spring-boot-dependencies-2.1.1.RELEAS
E.pom, line 2, column 7
[ERROR]     'groupId' is missing. @ [unknown-group-id]:[unknown-artifact-id]:[un
known-version], C:\Users\Administrator\.m2\repository\org\springframework\boot\s
pring-boot-dependencies\2.1.1.RELEASE\spring-boot-dependencies-2.1.1.RELEASE.pom
, line 2, column 7
[ERROR]     'artifactId' is missing. @ [unknown-group-id]:[unknown-artifact-id]:
[unknown-version], C:\Users\Administrator\.m2\repository\org\springframework\boo
t\spring-boot-dependencies\2.1.1.RELEASE\spring-boot-dependencies-2.1.1.RELEASE.
pom, line 2, column 7
[ERROR]     'version' is missing. @ [unknown-group-id]:[unknown-artifact-id]:[un
known-version], C:\Users\Administrator\.m2\repository\org\springframework\boot\s
pring-boot-dependencies\2.1.1.RELEASE\spring-boot-dependencies-2.1.1.RELEASE.pom
, line 2, column 7
[ERROR]     'dependencies.dependency.version' for org.springframework:spring-con
text-support:jar is missing. @ line 57, column 15
[ERROR]     'dependencies.dependency.version' for org.springframework:spring-web
:jar is missing. @ line 63, column 15
[ERROR]     'dependencies.dependency.version' for mysql:mysql-connector-java:jar
 is missing. @ line 76, column 21
[ERROR]     'dependencies.dependency.version' for javax.servlet:javax.servlet-ap
i:jar is missing. @ line 81, column 20
[ERROR]     'dependencies.dependency.version' for org.slf4j:slf4j-api:jar is mis
sing. @ line 87, column 15
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
gException

 一直找不到问题,直到在网上看到说需要删除cache再重新Reimport,才解决该问题,可能之前在下载包的时候中断,导致无法更新。

 

[WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: cn.dev33:sa-token-dao-redis-jackson:jar -> duplicate declaration of version 1.33.0 @ com.jian:ji_an_riding_master:1.0.0-SNAPSHOT, D:\develop\TaiYangGongShe_v2\ji_an_riding_master\pom.xml, line 205, column 25 [WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.alibaba:easyexcel:jar -> version 3.1.1 vs 3.0.5 @ com.jian:ji_an_riding_master:1.0.0-SNAPSHOT, D:\develop\TaiYangGongShe_v2\ji_an_riding_master\pom.xml, line 211, column 25 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] --------------------------< com.jian:manage >--------------------------- [INFO] Building 后端管理模块 1.0.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [WARNING] The POM for com.jian:service:jar:1.0.0-SNAPSHOT is missing, no dependency information available [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.484 s [INFO] Finished at: 2025-03-24T16:19:02+08:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal on project manage: Could not resolve dependencies for project com.jian:manage:jar:1.0.0-SNAPSHOT [ERROR] dependency: com.jian:service:jar:1.0.0-SNAPSHOT (compile) [ERROR] Could not find artifact com.jian:service:jar:1.0.0-SNAPSHOT [ERROR] [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. [ERROR] [ERROR] For m
最新发布
03-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值