I am new to Git and also to Jenkins. My problem is that I can\'t get the Jenkins Maven release plugin to work.
When I build a common Maven build with Jenkins, it wor
Add to maven command line for the release prepare: -DpushChanges=false -DlocalCheckout=true
This means maven would use what jenkins got inside working directory .git, and neither clone the remote or push to remote.
I recommend to configure fully qualified refs/remotes/origin/develop as your Git "Branch to build". This way it seems more understandable to me.
In such case your $GIT_BRANCH would get magically set by Jenkins to origin/develop
Then, instead of using overly complicated (but portable) GitPublisher, just add a post-build step "Execute Shell":
echo Remote branch is $GIT_BRANCH, replacing origin with refs/heads.
git push --follow-tags "$GIT_URL" "+HEAD:${GIT_BRANCH/#origin\//refs/heads/}"
This pushes whatever maven changed, like pom.xml and tags.