Maven多模块项目版本管理 [英] Maven multi-module project version management
问题描述
指定多模块Maven项目的版本的最佳实践是什么?
What is the best practice for specifying version of a multimodule maven project?
我希望所有模块都有一个版本字符串.即使我在根父pom中只能有一个版本定义,我也需要在每个pom中指定父pom版本.这意味着,如果需要更改版本,则需要更改所有pom.几乎达不到目的.有什么想法吗?
I would like to have one version string across all modules. Even if I can have only one version definition in the root parent pom, I need to specify the parent pom version in each pom's. Which means, if I need to change version, I need to change all poms. Practically defeats the purpose. Any ideas??
推荐答案
您是否尝试过版本-maven插件吗?
和 mvn versions:set -DnewVersion="1.1-SNAPSHOT"
一起,您可以在所有基础maven项目中设置给定的版本.
with mvn versions:set -DnewVersion="1.1-SNAPSHOT"
you are able to set in all underlying maven projects the given version.
之后,您必须执行 mvn versions:commit
删除临时文件并提交到VCS
Afterwards you have to do a mvn versions:commit
to remove temporary files and commit to your VCS
这篇关于Maven多模块项目版本管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!