maven发布:prepare无法发布带有补丁版本的pom.xml
我不确定我在这里做错了什么,或者 maven-release-plugin 中是否有错误。但是当我尝试发布版本 1.2.1 时,maven 创建了一个具有正确版本的标签,但标签的 pom.xml 中设置的版本号设置为 1.2(而不是应有的 1.2.1)。
这就是我尝试修复 1.2 中的错误时所做的:
- svn cp URL/tags/myapp-1.2 URL/branches/myapp-1.2
- 将 URL/branches/myapp-1.2/pom.xml 中的 project.version 编辑为 1.2 .1-SNAPSHOT (was 1.2)
- 中的错误
- 修复源提交更改
- mvn release:prepare
- #当询问时,使用默认值:发布版本 1.2.1,下一个开发版本 1.2.2-SNAPSHOT
- [INFO] BUILD SUCCESSFUL
OK 到目前为止,但是如果我检查新标签中的代码,版本是错误的! URL/tags/myapp-1.2.1/pom.xml 的版本为 1.2,而不是标签名称所暗示的 1.2.1。如果我现在运行 mvn release:perform,新上传的 jar 的名称将设置为 myapp-1.2.jar,覆盖存储库中的原始 jar。
我已将 maven-release-plugin 版本从 2.0 升级到 2.1,但没有取得更大的成功。我知道导致此错误的原因是插件执行此操作的过程的一部分:
svn --non-interactive copy --file /tmp/maven-scm-2371633.commit --revision 19866 URL/tags/myapp-1.2 URL/tags/myapp-1.2.1
这会将源从tags/myapp-1.2复制到tags/myapp-1.2.1,但这不包含任何更改。您是否同意它应该从 Branches/myapp-1.2 复制,而不是从标签复制?
这对其他人有用吗?你看看我做错了什么吗?
I am not sure if I am doing something wrong here, or if there is a bug in maven-release-plugin. But when I try to release a version 1.2.1, maven creates a tag with the right version, but the version number set in the tag's pom.xml is set at 1.2 (not 1.2.1 as it should).
This is what I do when I tried to fix a bug in 1.2:
- svn cp URL/tags/myapp-1.2 URL/branches/myapp-1.2
- edit project.version in URL/branches/myapp-1.2/pom.xml to be 1.2.1-SNAPSHOT (was 1.2)
- fix the bug in the source
- commit changes
- mvn release:prepare
- #when asked, use the defaults: release version 1.2.1, next dev version 1.2.2-SNAPSHOT
- [INFO] BUILD SUCCESSFUL
OK so far, but if I check out the code in the new tag the version is wrong! URL/tags/myapp-1.2.1/pom.xml has version 1.2, not 1.2.1 as the tag name should suggest. If I just run mvn release:perform now, the new uploaded jar will have its name set to myapp-1.2.jar, overwriting the original in the repository.
I have upped the maven-release-plugin version from 2.0 to 2.1, but with no greater success. I know the thing that causes this error is the part of the process where the plugin does this:
svn --non-interactive copy --file /tmp/maven-scm-2371633.commit --revision 19866 URL/tags/myapp-1.2 URL/tags/myapp-1.2.1
This copies the source from tags/myapp-1.2 to tags/myapp-1.2.1, but this does not contain any changes. Do you agree that it should have copied from branches/myapp-1.2, not the tag?
Is this working for anyone else, and do you see if I am doing anything wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要验证 pom 中的存储库链接是否指向分支而不是主干。
如果是这种情况,那么您将收到错误。相反,请将其指向行李箱。
You need to verify if the repository link in your pom is pointing to a branch instead of the trunk.
If that is the case, then you'll get the error. Point it to the trunk, instead.