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

标签 svn maven-2 branch

我在主干中开发,并定期使用 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/

相关文章:

SVN 标记主要版本

svn:E175002: '/xxxx-demo/!svn/vcc/default'的报告:无法读取响应正文:安全连接被截断

java - 如何使用 Maven 创建具有依赖项的可执行/可运行 JAR?

java - 使用 maven2 构建和使用 jhears

maven-2 - Maven、Hudson 和动态 Clearcase View

git - 如何使用 Git SVN fetch 获取单个分支?

svn - Xcode 4.3 如何使用 SVN 合并来自两个开发人员的 Storyboard更改?

svn - 有没有办法在提交自己的更改时自动更新 SVN 外部的 Hook 修订?

tfs - TFS 2010 中的许多分支有哪些可扩展性和性能限制?

git - 如何创建远程 Git 分支?