使用 maven-release-plugin,如何对模块及其子模块进行分支?
假设你有一个名为“parent”的模块,它有 2 个子模块“childA”和“ChildB”
如果我
mvn release:branch -DbranchName=my-branch
在“parent”文件夹中运行,它会将父模块代码分支到 SVN /branches/my-branch,而没有 2 个子模块。
我希望 release:branch 将父模块及其所有子模块分支到
- /branches/my-branch/parent
- /branches/my-branch/childA
- /branches/my-branch/childB
我在文档中没有找到任何解决方案然而:
- http://maven.apache.org/plugins/maven-release-plugin/branch-mojo.html
- http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html
可行吗?
任何帮助将不胜感激,
谢谢弗雷德
Say you have a module named "parent" which has 2 childs "childA" and "ChildB"
If I run
mvn release:branch -DbranchName=my-branch
in the "parent" folder, it will branch the parent module code to SVN /branches/my-branch WITHOUT the 2 child modules.
I would like release:branch to branch the parent module and all its children to
- /branches/my-branch/parent
- /branches/my-branch/childA
- /branches/my-branch/childB
I didn't found any solution in the doc yet:
- http://maven.apache.org/plugins/maven-release-plugin/branch-mojo.html
- http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html
Is it feasible ?
Any help would be appreciated, thanks
Fred
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案。
如果模块是分层结构的,那么它可以工作:
/trunk/parent
/主干/父/子A
/trunk/parent/childB
但您必须确保SCM 参数100% 正确。
即:
/trunk/parent/pom.xml
/trunk/parent/childA/pom.xml
/trunk/parent/childB/pom.xml
然后,当您运行以下命令时:
mvn release:branch -DbranchName= -DupdateBranchVersions=true -DupdateWorkingCopyVersions=true -DreleaseVersion= -DdevelopmentVersion=
所有模块都正确分支到 /branches/,所有版本和 SCM 属性都会自动更新
I found the solution.
if the modules are structured hierarchically it works:
/trunk/parent
/trunk/parent/childA
/trunk/parent/childB
but you must ensure that SCM parameters are 100% correct.
i.e.:
/trunk/parent/pom.xml
/trunk/parent/childA/pom.xml
/trunk/parent/childB/pom.xml
Then when you run the following command:
mvn release:branch -DbranchName= -DupdateBranchVersions=true -DupdateWorkingCopyVersions=true -DreleaseVersion= -DdevelopmentVersion=
All modules are correctly branched to /branches/ with all versions and SCM properties automatically updated