Status: Closed (View Workflow)
Hudson doesn't checkout the master branch. Hudson uses an 'unnamed' branch therefore:
Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref
Hmm - dunno how to resolve that. Perhaps the Git plugin should handle the checkout different ... But nevertheless the issue surfaces here
- depends on
JENKINS-6856 Git builds with detached head no matter what
I see the same thing. By default, the workspace is in (no branch).
If I manually run
mvn -X -B -f /[jenkins]/jobs/[job]/workspace/pom.xml -Dresume=false release:prepare release:perform
.. it ends with a
org.apache.maven.scm.ScmException: Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref
If I first do a 'git checkout master', and then repeat the command it works fine.
Back in Jenkins, I then configured the job's - SCM section with Branch Specifier: "master", and under Advanced I entered Checkout/merge to local branch (optional): "master"
After that it works fine. Still, it's a bit annoying that it didn't work by default. I don't know if this is the fault of the maven-release-plugin (should it be possible to make a release when not on a branch?).. but not having to configure this for each job would be nice.
I'm facing the same issue as tfnico with 1.409.2 and git plugin 1.1.12
git plugin does checkout commits by RefID, not branches. You can force it to use a local branch (advanced section) so that maven release process will be able to commit, tag and push to remote repository
What is the reason behind that decision? Why does it not check out the branch?
This is especially confusing as you already were branch-specific when specifying the branch specifier.
When you specify the job shall build master, why does it not check out master?
This is working if I use the m2 extra steps plugin and the following config
"Merge before build" origin, master
And m2 extra steps (pre-build)
git checkout master || git checkout -b master
git reset --hard origin/master