Jenkins Git plugin detached HEAD
UPDATE (November 2015): Please, note that this solution was given for a specific version of Git plugin (1.1.26). In later versions, the plugin was updated to make configuration easier.
For Jenkins Git plugin version 1.1.26 try this:
Go to Job Configuration. Scroll down to Git section and click "Advanced..." button under "Repositories". Then set:
Name: originRefspec: +refs/heads/branch-0.1:refs/remotes/origin/localbranchname
Then click another "Advanced..." button and set:
Checkout/merge to local branch (optional): localbranchname
You can name the local branch as you like, but the destination in Refspec must match the local branch name in that optional field (in this case "localbranchname"). This will attach HEAD to localbranchname like this:
HEAD -> refs/heads/localbranchname -> 7a698457751bdc043cfda631b81e3812c5361790
Maven Release should pass now in Jenkins.
By the way, this works for me with Jenkins 1.492 and Jenkins Git plugin version 1.1.26.