在多模块Maven项目中更新模块的版本号

本文介绍了如何在多模块Maven项目中统一管理版本号,避免在每个模块的pom.xml中硬编码。建议在父模块中指定,并在子模块中引用。此外,可以使用Versions Maven插件的update-properties目标更新所有模块的版本和依赖。对于自动化版本更新,可以考虑使用Maven的release插件。
摘要由CSDN通过智能技术生成

本文翻译自:Updating version numbers of modules in a multi-module Maven project

I have a multi-module maven project. 我有一个多模块的Maven项目。 We intend to version all these modules together. 我们打算将所有这些模块一起版本化。 But as of now I am ending up hard-coding version in each of the module pom.xml as below 但是到目前为止,我将在每个模块pom.xml中结束硬编码版本,如下所示

<parent>
    <artifactId>xyz-application</artifactId>
    <groupId>com.xyz</groupId>
    <version>2.50.0.g</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xyz</groupId>
<artifactId>xyz-Library</artifactId>
<version>2.50.0.g</version>

and the main parent module has the below configuration 并且主父模块具有以下配置

<modelVersion>4.0.0</modelVersion>
<groupId>com.xyz</groupId>
<artifactId>xyz-application</artifactId>
<version>2.50.0.g</version>
<packaging>pom</packaging>

#1楼

参考:https://stackoom.com/question/O1fX/在多模块Maven项目中更新模块的版本号</

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值