使用 Maven 从标签创建分支
我在主干中开发并定期使用 Maven 发布插件标记“稳定版本”。例如:
/trunk is MyProject 1.1-SNAPSHOT
创建稳定版本
/tags/MyProject-1.1
工作正常,没有问题,非常完美。
有时我必须部署修补程序,但主干尚未准备好。所以我需要来自最后一个稳定标签的分支。 maven 可以帮我吗?目前我将标签复制到新的分支位置 /branches/MyProject-1.1.1-SNAPSHOT
并使用 mvn versions:set
更新版本
I develop in trunk and periodically tag "stable releases" with the maven release plugin. For example:
/trunk is MyProject 1.1-SNAPSHOT
creates the stable release
/tags/MyProject-1.1
Works fine, no problems, just perfect.
Sometimes I have to deploy a hotfix but the trunk isn't ready, yet. So I need a branch from the last stable tag. Can maven help me here? Currently I copy the tag to the new branch location/branches/MyProject-1.1.1-SNAPSHOT
and update the versions with mvn versions:set
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Maven Release Plugin 及其
release:branch
可以提供帮助。检查标签并从标签创建分支:资源
The Maven Release Plugin and its
release:branch
can help. Check out the tag and create a branch from the tag:Resources
如果您在 svn 中有一个具有 trunk/tags/branches 结构的标准项目:
您应该
mvn release:branch -DbranchName=theNewBranchFrom12 -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false -Dtag=MyProject-1.2
之后您应该看到 MyProject\branches\theNewBranchFrom12根据您在执行release:branch时的建议修改pom文件。
If you have a standard project in svn with trunk/tags/branches structure:
You should
mvn release:branch -DbranchName=theNewBranchFrom12 -DupdateBranchVersions=true -DupdateWorkingCopyVersions=false -Dtag=MyProject-1.2
After that you should see MyProject\branches\theNewBranchFrom12 with pom files modified according to what you suggested when release:branch was executed.