记一次maven项目clean install失败 'version' contains an expression but should be a constant.

本文分享了一种解决Maven项目中子POM无法解析父POM依赖的问题,通过移除特定代码行使项目能够在本地仓库中正常进行clean install操作。

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

情景:
首先建了一个父pom然后建了几个子pom,在clean的时候报错

 Non-resolvable parent POM for com.mamcharger.fae:fae-register:${project.parent.version}

因为在子pom里面加了下面那一行代码 无法加到本地仓库,去掉后在clean install 就好了

在这里插入图片描述

假如你也遇到这样的问题 试一下 是不是就问题解决了

[ERROR] [ERROR] Some problems were encountered while processing the POMs: [WARNING] 'version' contains an expression but should be a constant. @ com.kmsoft.extend:PLM-EXTEND:${kmcloud.ext.version}, E:\IDEA\plm-ext-main\pom.xml, line 10, column 14 [FATAL] Non-resolvable parent POM for com.kmsoft.extend:plm-taskPlan-server:4.0.2-E1.0: Cannot access aliyunmaven (https://maven.aliyun.com/repository/public) in offline mode and the artifact com.kmsoft.extend:PLM-EXTEND:pom:4.0.2-E1.0 has not been downloaded from it before. and 'parent.relativePath' points at wrong local POM @ line 5, column 13 [WARNING] 'version' contains an expression but should be a constant. @ com.kmsoft.extend:PLM-EXTEND:${kmcloud.ext.version}, E:\IDEA\plm-ext-main\pom.xml, line 10, column 14 [WARNING] 'version' contains an expression but should be a constant. @ com.kmsoft.extend:kmwp-ext-server:${kmcloud.ext.version}, E:\IDEA\plm-ext-main\kmwp-ext-server\pom.xml, line 12, column 14 [WARNING] 'version' contains an expression but should be a constant. @ com.kmsoft.extend:PLM-EXTEND:${kmcloud.ext.version}, E:\IDEA\plm-ext-main\pom.xml, line 10, column 14 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.kmsoft.extend:plm-taskPlan-server:4.0.2-E1.0 (E:\IDEA\plm-ext-main\plm-taskPlan-server\pom.xml) has 1 error [ERROR] Non-resolvable parent POM for com.kmsoft.extend:plm-taskPlan-server:4.0.2-E1.0: Cannot access aliyunmaven (https://maven.aliyun.com/repository/public) in offline mode and the artifact com.kmsoft.extend:PLM-EXTEND:pom:4.0.2-E1.0 has not been downloaded from it before. and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2] [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 more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] h
03-14
maven执行install时出错[ERROR] [ERROR] Some problems were encountered while processing the POMs: [FATAL] Non-resolvable parent POM for com.jzo2o:jzo2o-seata:1.0-SNAPSHOT: Could not find artifact com.jzo2o:jzo2o-parent:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 13 [WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.alibaba.cloud:spring-cloud-starter-alibaba-sentinel:jar -> duplicate declaration of version ${spring-cloud-alibaba.version} @ com.jzo2o:jzo2o-parent:1.0-SNAPSHOT, E:\BaiduNetdiskDownload\jzo2o\jzo2o-framework\jzo2o-parent\pom.xml, line 279, column 25 [WARNING] 'version' contains an expression but should be a constant. @ com.jzo2o:jzo2o-knife4j-web:${project.parent.version}, E:\BaiduNetdiskDownload\jzo2o\jzo2o-framework\jzo2o-knife4j-web\pom.xml, line 14, column 14 [WARNING] 'dependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.alibaba.cloud:spring-cloud-starter-alibaba-sentinel:jar -> duplicate declaration of version ${spring-cloud-alibaba.version} @ line 279, column 25 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.jzo2o:jzo2o-seata:1.0-SNAPSHOT (E:\BaiduNetdiskDownload\jzo2o\jzo2o-framework\jzo2o-seata\pom.xml) has 1 error [ERROR] Non-resolvable parent POM for com.jzo2o:jzo2o-seata:1.0-SNAPSHOT: Could not find artifact com.jzo2o:jzo2o-parent:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 6, column 13 -> [Help 2] [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 more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/d
03-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值