使用 maven-release-plugin,如何对模块及其子模块进行分支?

发布于 2024-11-15 00:56:16 字数 821 浏览 8 评论 0原文

假设你有一个名为“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

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

可行吗?

任何帮助将不胜感激,

谢谢弗雷德

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:

Is it feasible ?

Any help would be appreciated, thanks

Fred

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

站稳脚跟 2024-11-22 00:56:16

我找到了解决方案。

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

/trunk/parent
/主干/父/子A
/trunk/parent/childB

但您必须确保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 属性都会自动更新

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

<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>

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文