简体   繁体   English

maven-release-plugin是否将标签推送到远程Git存储库?

[英]Does maven-release-plugin push tags to remote Git repository?

When using the maven-release-plugin with Git, mvn release:prepare happily tags the release in the local repository. 当使用maven-release-plugin和Git时,mvn release:prepare happyly标记本地存储库中的发行版。 I'd expect mvn release:perform to push the tags to the remote repository, but this doesn't seem to happen. 我期望MVN发布:执行到标签推到远程存储库,但是这似乎并没有发生。

Am I mistaken? 我错了吗?

If not, is there an option to enable pushing release tags to the remote repository? 如果没有,是否有选项可以将释放标记推送到远程存储库?

For me, release-prepare seems to be pushing three times: 对我来说, release-prepare似乎推了三次:

  1. After committing the POM updated to the new release version, it's running git push with no arguments, to push that commit. 在将POM更新到新版本后,它正在运行没有参数的git push来推送该提交。
  2. After tagging, it's running git push origin <tagname> , which is what should push the tag. 标记之后,它正在运行git push origin <tagname> ,这应该是标记的推送。
  3. After committing the POM updated to the new snapshot version, it's running git push with no arguments again. 在将POM更新为新快照版本之后,它正在运行git push而不再使用任何参数。

Given that it's explicitly specifying origin for the tag push, it may only successfully push the tags if your git-remote alias is actually called origin . 鉴于它明确指定了标签推送的origin ,如果您的git-remote别名实际上被称为origin ,它可能只能成功推送标签。 To see what yours are called, run git remote -v . 要查看你的名字,请运行git remote -v

Note also that git push without arguments may default to something other than origin , depending on your repository config - ie it may have been trying to push commits to one place and tags to another. 另请注意,没有参数的git push可能默认为origin以外的其他内容,具体取决于您的存储库配置 - 即它可能已尝试将提交推送到一个位置并将标签推送到另一个位置。 See here for where those defaults come from: http://www.kernel.org/pub/software/scm/git/docs/git-push.html#REMOTES 请参阅此处了解这些默认值的来源: http//www.kernel.org/pub/software/scm/git/docs/git-push.html#REMOTES

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM