为什么 mvn release:prepare 在标记时失败?
使用我的多项目 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
此问题已在最新版本的 maven-release-plugin 中得到解决。 将其添加到您的 POM 中以将其拉入。
已修复的问题是 MRELEASE-375 。
This issue is addressed in the latest version of the maven-release-plugin. Add this to your POM to pull it in.
The issue that was fixed is MRELEASE-375.
这是因为您没有增加版本号 - 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.
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)
可能有用的链接:
http://weblogs.java.net/ blog/johnsmart/archive/2008/12/subversion_mave.html(前面提到过)
http ://jira.codehaus.org/browse/MRELEASE-427(真正的错误?)
http://jira.codehaus.org/browse/SCM-406(相关错误)
http://olafsblog.sysbsb.de/?p=73(更新且可能更有帮助的帖子)
Potentially useful links:
http://weblogs.java.net/blog/johnsmart/archive/2008/12/subversion_mave.html (previously mentioned)
http://jira.codehaus.org/browse/MRELEASE-427 (the real bug?)
http://jira.codehaus.org/browse/SCM-406 (related bug)
http://olafsblog.sysbsb.de/?p=73 (newer and perhaps more helpful post)
据我所知,这是 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.
我花了很长时间与这个斗争。 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.
这是最新版本插件版本 2.0-beta-9 中已修复
This is fixed in the newest release plugin release, 2.0-beta-9
我看到这篇文章是因为我在没有安装 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