【问题标题】:With the maven-release-plugin, how to branch a module and its children?使用 maven-release-plugin,如何分支模块及其子模块?
【发布时间】:2011-06-13 21:04:50
【问题描述】:

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

如果我跑了

mvn release:branch -DbranchName=my-branch

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

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

  • /branches/my-branch/parent
  • /branches/my-branch/childA
  • /branches/my-branch/childB

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

可行吗?

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

弗雷德

【问题讨论】:

    标签: maven maven-release-plugin


    【解决方案1】:

    我找到了解决办法。

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

    /主干/父级 /主干/父/子A /主干/父/子B

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

    即:

    /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 属性

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-26
      • 2014-06-03
      • 2015-03-25
      • 2013-04-24
      • 2014-10-07
      • 1970-01-01
      相关资源
      最近更新 更多