使用maven-release-plugin,如何分支模块及其子级? [英] With the maven-release-plugin, how to branch a module and its children?
问题描述
假设您有一个名为父母"的模块,其中有两个孩子"childA"和"ChildB"
Say you have a module named "parent" which has 2 childs "childA" and "ChildB"
如果我运行
mvn release:branch -DbranchName=my-branch
在父"文件夹中,它将把父模块代码分支到SVN/branches/my-branch,而没有2个子模块.
in the "parent" folder, it will branch the parent module code to SVN /branches/my-branch WITHOUT the 2 child modules.
我想要release:branch将父模块及其所有子模块分支到
I would like release:branch to branch the parent module and all its children to
- /branchches/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
- http://maven.apache.org/plugins/maven-release-plugin/branch-mojo.html
- http://maven.apache.org/plugins/maven-release-plugin/examples/branch.html
可行吗?
任何帮助将不胜感激,谢谢
Any help would be appreciated, thanks
弗雷德
推荐答案
我找到了解决方案.
如果模块是按层次结构构建的,那么它将起作用:
if the modules are structured hierarchically it works:
/trunk/parent /trunk/parent/childA /trunk/parent/childB
/trunk/parent /trunk/parent/childA /trunk/parent/childB
但是您必须确保SCM参数正确100%.
but you must ensure that SCM parameters are 100% correct.
即:
/trunk/parent/pom.xml
/trunk/parent/pom.xml
<scm>
<connection>scm:svn:https://svnserver:18080/svn/trunk</connection>
<developerConnection>scm:svn:https://svnserver:18080/svn/trunk</developerConnection>
<url>https://svnserver:18080/viewvc/trunk</url>
</scm>
/trunk/parent/childA/pom.xml
/trunk/parent/childA/pom.xml
<scm>
<connection>scm:svn:https://svnserver:18080/svn/trunk/childA</connection>
<developerConnection>scm:svn:https://svnserver:18080/svn/trunk/childA</developerConnection>
<url>https://svnserver:18080/viewvc/trunk/childA</url>
</scm>
/trunk/parent/childB/pom.xml
/trunk/parent/childB/pom.xml
<scm>
<connection>scm:svn:https://svnserver:18080/svn/trunk/childB</connection>
<developerConnection>scm:svn:https://svnserver:18080/svn/trunk/childB</developerConnection>
<url>https://svnserver:18080/viewvc/trunk/childB</url>
</scm>
然后在运行以下命令时: mvn版本:branch -DbranchName = -DupdateBranchVersions = true -DupdateWorkingCopyVersions = true -DreleaseVersion = -DdevelopmentVersion =
Then when you run the following command: mvn release:branch -DbranchName= -DupdateBranchVersions=true -DupdateWorkingCopyVersions=true -DreleaseVersion= -DdevelopmentVersion=
所有模块均正确分支到/branches/,并且所有版本和SCM属性均自动更新
All modules are correctly branched to /branches/ with all versions and SCM properties automatically updated
这篇关于使用maven-release-plugin,如何分支模块及其子级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!