maven多模块项目编译一直报Failure to find com.xxx.xxx:xxx-xxx-xxx:pom:1.0-SNAPSHOT in问题

工作中项目上因为多版本迭代,需要对不同迭代版本升级版本号,且因为项目工程本身是多模块结构,且依然多个其他模块工程。

在将工程中子模块的pom.xml中版本号使用变量引用父模块中定义的版本号时,一直报Failure to find com.xxx.xxx:xxx-xxx-xxx:pom:1.0-SNAPSHOT in

最后发现是因为版本号变量引用时写法不正确导致的,

正确的:<version>${re.version}</version>

写成了:<version>{$re.version}</version>

java 复制代码
<groupId>com.xxx.xxx</groupId>
    <artifactId>xxx-xxx</artifactId>
    <version>{$re.version}</version>
    <packaging>pom</packaging>
    <modules>
        <module>xxx-xxx-xx1</module>
        <module>xxx-xxx-xx2</module>
    </modules>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <re.version>1.0-CUB-SNAPSHOT</re.version>
    </properties>
相关推荐
Flynn Liang6 分钟前
I/O 密集型高并发实战:Java 服务 10 维优化,从线程打满到 10 万 QPS
java·spring boot·性能优化·高并发·系统设计·虚拟线程·io密集型
吃我一窝jio1 小时前
Python与Go线程模型深度对比
java·开发语言·python
这个昵称不容易1 小时前
SpringBoot 购物推荐网站的设计与实现:120 个 Java 文件、147 个接口、13 张表,附真实运行截图
java·springboot·毕设
文丑颜不良啊1 小时前
LeetCode3041~3060题目解析
java·leetcode
eggwyw1 小时前
C++ union 的一种妙用法
开发语言·c++
文丑颜不良啊3 小时前
LeetCode3101~3120题目解析
java·leetcode
Resean02233 小时前
SpringMVC 6+源码分析(十一)视图渲染与异步请求(收尾篇)
java·spring·springmvc
starzy19904 小时前
深入理解Scala隐式函数:自动类型转换
开发语言·后端·scala
靠沿4 小时前
MySQL数据库进阶——存储过程和触发器
java·数据库·mysql
码少女5 小时前
MySQL--库与表的增删改查基础
java·数据库·mysql