gpt4 book ai didi

svn - 使用 Maven 从标签创建分支

转载 作者:行者123 更新时间:2023-12-02 13:50:30 24 4
gpt4 key购买 nike

我在主干中开发,并定期使用 Maven 发布插件标记“稳定版本”。例如:

/trunk 是 MyProject 1.1-SNAPSHOT

创建稳定版本

/tags/MyProject-1.1

工作正常,没有问题,非常完美。

有时我必须部署修补程序,但主干尚未准备好。所以我需要来自最后一个稳定标签的分支。 maven 可以帮我吗?目前我将标签复制到新的分支位置/branches/MyProject-1.1.1-SNAPSHOT 并使用 mvn versions:set

更新版本

最佳答案

So I need a branch from the last stable tag. Can maven help me here?

Maven 发布插件及其 release: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

Specify versions on the command line

You may want to specify the versions to use on the command line. This can be useful for example if you are running the release in non-interactive mode. The branch goal can use the same properties used by the prepare goal for specifying the versions to be used.

mvn --batch-mode release:branch -DbranchName=my-branch-1.2 -Dproject.rel.org.myCompany:projectA=1.2 \
-Dproject.dev.org.myCompany:projectA=2.0-SNAPSHOT

In this example, the POM in the new branch will be set to the version 1.2-SNAPSHOT, and the local POM will be set to the version 2.0-SNAPSHOT.

资源

关于svn - 使用 Maven 从标签创建分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3812262/

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