为什么 mvn release:prepare 在标记时失败?

发布于 2024-07-04 13:07:06 字数 739 浏览 9 评论 0原文

使用我的多项目 pom,我在运行 release:prepare 时遇到错误。 项目设置没有什么特别的,之前的每个发布步骤都运行良好。 我得到的错误是:

    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Unable to tag SCM
    Provider message:
    The svn tag command failed.
    Command output:
    svn: Commit failed (details follow):
    svn: File '/repos/june/tags/foo-1.0.2/foo.bar.org/pom.xml' already exists

知道它来自哪里以及如何绕过它吗?

(抱歉重复的帖子 - 首先被关闭,因为我没有将其表述为可以回答的问题。我希望现在可以了。)

编辑
Maven 发布插件负责版本处理本身。 因此,当我检查 subversion 存储库中的路径时,该路径尚不存在。

编辑2
@Ben:我不知道服务器版本,但客户端也是1.5.2。

With my multiproject pom I get an error while running release:prepare. There is nothing fancy about the project setup and every release-step before runs fine.
The error I get is:

    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Unable to tag SCM
    Provider message:
    The svn tag command failed.
    Command output:
    svn: Commit failed (details follow):
    svn: File '/repos/june/tags/foo-1.0.2/foo.bar.org/pom.xml' already exists

Any idea where it comes from and how to get around it?

(sorry for duplicate post - first was closed because I didn't formulate it as a question that can be answered. I hope it's ok now.)

EDIT
The maven release plugin takes care of the version handling itself. So when I check the path in the subversion repository the path does not yet exist.

EDIT 2
@Ben: I don't know the server version, however the client is 1.5.2, too.

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

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

发布评论

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

评论(8

情绪 2024-07-11 13:07:06

此问题已在最新版本的 maven-release-plugin 中得到解决。 将其添加到您的 POM 中以将其拉入。

<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.0-beta-9</version>
      </plugin>
    </plugins>
  </pluginManagement>
</build>

已修复的问题是 MRELEASE-375

This issue is addressed in the latest version of the maven-release-plugin. Add this to your POM to pull it in.

<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.0-beta-9</version>
      </plugin>
    </plugins>
  </pluginManagement>
</build>

The issue that was fixed is MRELEASE-375.

旧伤慢歌 2024-07-11 13:07:06

这是因为您没有增加版本号 - 1.0.2 已经存在于您的 Subversion 存储库中。

要么增加您的版本,要么只是从您的存储库中删除 /repos/june/tags/foo-1.0.2 标签。

It's because you haven't increased the version number - 1.0.2 already exists in your Subversion repo.

Either increment your version or just remove the /repos/june/tags/foo-1.0.2 tag from your repo.

森末i 2024-07-11 13:07:06

Roland,如果您还没有看到这一点,请查看 John Smart 关于此问题的博客文章。 尽管他提出的脚本不太优雅,但它解决了问题:

http ://weblogs.java.net/blog/johnsmart/archive/2008/12/subversion_mave.html

另一种解决方案是使用 Git。 (我==目前正在写关于Maven和Git的文章)

Roland, if you haven't seen this already, take a look at John Smart's blog post about this problem. Although the script he proposes is inelegant, it solves the problem:

http://weblogs.java.net/blog/johnsmart/archive/2008/12/subversion_mave.html

The other solution is to use Git. (Me == currently writing about Maven and Git)

〆凄凉。 2024-07-11 13:07:06

据我所知,这是 Subversion 1.5 中的一个错误,与 maven 没有直接关系。 然而,解决这个问题的一个解决方法是更新本地 svn 存储库并再次运行release:prepare 目标。

As far as I know it is a bug in Subversion 1.5 and not directly related with maven. However a workaround the fixed it for me is to update the local svn repository and run the release:prepare goal again.

朮生 2024-07-11 13:07:06

我花了很长时间与这个斗争。 SVN 1.5.1+ 中有些不同,它中断了直接从工作副本提交到标签的操作 - 这正是 Maven 所做的。 对于谁负责解决这个问题仍然存在很多指责。

您可以执行“svn update”并重新运行release命令,但如果您正在执行release:branch,这将导致release插件不会将您的POM文件返回到之前的状态。

据我所知,最好的解决方法是退回到 Subversion 1.5.0。

I spent quite a while fighting with this. Something is different in SVN 1.5.1+ that breaks committing to a tag straight from the working copy - which is exactly what Maven does. There's still a lot of finger-pointing as to who's responsible for fixing the problem.

You can do an 'svn update' and rerun the release command but if you're doing a release:branch, this will cause the release plugin not to return your POM files to their previous state.

The best workaround I know of is to drop back to Subversion 1.5.0.

秋千易 2024-07-11 13:07:06

这是最新版本插件版本 2.0-beta-9 中已修复

This is fixed in the newest release plugin release, 2.0-beta-9

烛影斜 2024-07-11 13:07:06

我看到这篇文章是因为我在没有安装 svn 的服务器上遇到了构建问题。

这有助于:
Jenkins 与 Subversion

I hit this post as I was having a build issue on a server that did not have svn installed.

This helped:
Jenkins with Subversion

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