gpt4 book ai didi

Maven 发布 :branch

转载 作者:行者123 更新时间:2023-12-04 21:49:24 31 4
gpt4 key购买 nike

我有一个 Maven 多模块项目。

当代码开发完成后,我们想在 Jenkins 中编写一个分支构建作业,它分支代码,增加主干中的 pom 版本,并删除
-SNAPSHOT 来自分支中的 pom 版本。

所以,如果主干是 2.2-SNAPSHOT,到操作结束时,主干应该是 2.3-SNAPSHOT,并且新创建的分支应该有 2.2 的 poms。

当我使用 release:branch 时,主干正在更新,但它没有从分支中的 pom 中删除 -SNAPSHOT。

如果您有任何实现这一目标的想法,请告诉我。

提前致谢。

最佳答案

来自 Maven Release plugin: Create a branch

By default, the POM in the new branch keeps the same version as the local working copy, and the local POM is incremented to the next revision. If you want to update versions in the new branch and not in the working copy, run:

mvn release:branch -DbranchName=my-branch -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false

Note: This can be useful if you want to create a branch from a tag


作为替代方案,您可能想尝试 Versions Maven plugin :

mvn versions:set versions:commit -DnewVersion=2.2.0


您仍然需要手动创建分支...

关于Maven 发布 :branch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7686889/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com