When using the maven-release-plugin with Git, mvn release:prepare happily tags the release in the local repository. I'd expect mvn release:perform to push the tags to the remote repository, but this doesn't seem to happen.
Am I mistaken?
If not, is there an option to enable pushing release tags to the remote repository?
By default, the git push command doesn't transfer tags to remote servers. You will have to explicitly push tags to a shared server after you have created them. This process is just like sharing remote branches — you can run git push origin <tagname> .
The plugin will extract file revisions associated with the current release. Maven will compile, test and package the versioned project source code into an artifact. The final deliverable will then be released into an appropriate maven repository.
Sharing tags is similar to pushing branches. By default, git push will not push tags. Tags have to be explicitly passed to git push .
Use git push to push commits made on your local branch to a remote repository.
For me, release-prepare
seems to be pushing three times:
git push
with no arguments, to push that commit.git push origin <tagname>
, which is what should push the tag.git push
with no arguments again.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
.
To see what yours are called, run git remote -v
.
Note also that git push
without arguments may default to something other than origin
, depending on your repository config - i.e. it may have been trying to push commits to one place and tags to another. See here for where those defaults come from:
http://www.kernel.org/pub/software/scm/git/docs/git-push.html#REMOTES
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With