1

假设您有一个名为“parent”的模块,它有 2 个孩子“childA”和“ChildB”

如果我跑

mvn release:branch -DbranchName=my-branch

在“父”文件夹中,它将父模块代码分支到 SVN /branches/my-branch 而没有 2 个子模块。

我想 release:branch 将父模块及其所有子模块分支到

  • /分支机构/我的分支机构/父母
  • /分支机构/我的分支机构/childA
  • /分支机构/我的分支机构/childB

我还没有在文档中找到任何解决方案:

可行吗?

任何帮助将不胜感激,谢谢

弗雷德

4

1 回答 1

2

我找到了解决方案。

如果模块是分层结构的,它可以工作:

/trunk/parent /trunk/parent/childA /trunk/parent/childB

但您必须确保 SCM 参数 100% 正确。

IE:

/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

<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

<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 release:branch -DbranchName= -DupdateBranchVersions=true -DupdateWorkingCopyVersions=true -DreleaseVersion= -DdevelopmentVersion=

所有模块都正确分支到 /branches/ 并自动更新所有版本和 SCM 属性

于 2011-06-16T05:42:03.040 回答