Jenkins Git plugin detached HEAD

0 votes

I’m new to git and Jenkins. When I build a common Maven build with Jenkins, it works well, but when I try to perform a release with the Maven release plugin I’m getting the following error

[INFO] Executing: /bin/sh -c cd
/var/lib/jenkins/workspace/test_maven/parent && git symbolic-ref HEAD
[INFO]  Working directory:
/var/lib/jenkins/workspace/test_maven/parent  mojoFailed
projectFailed ch.apkern.achilles:parent:1.0-SNAPSHOT  sessionEnded
Aug 6, 2018 in Jenkins by Hannah
• 18,570 points

2 answers to this question.

0 votes

Try this, it worked for me

Repository URL: <repo>

Branches to build: master

Checkout/merge to local branch (optional): master

answered Aug 6, 2018 by Kalgi
• 52,370 points
0 votes

Go to Job Configuration. Scroll down to Git section and click "Advanced..." button under "Repositories". Then set:

Name: origin
Refspec: +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 local branch as you like, but destination in Refspec must match local branch name in that optional field (in this case "localbranchname"). This will attach HEAD to localbranchname like this:

HEAD -> refs/heads/localbranchname -> 7a698457751bdc043cfda631b81e3812c5361790
answered Aug 13, 2018 by lina
• 8,220 points

Related Questions In Jenkins

+1 vote
2 answers

What possible return values are there in Jenkins plugin “Sonarqube scanner”

Use Webhooks in SonarQube Administration setup to ...READ MORE

answered Aug 3, 2018 in Jenkins by Nilesh
• 7,040 points
0 votes
1 answer

sonar XML plugin installation failure in jenkins

You can try this link which SonarQube XML ...READ MORE

answered Jun 21, 2018 in Jenkins by Atul
• 10,230 points
0 votes
1 answer

Jenkins: Build Pipeline Plugin Scheduled Trigger

This can be done by setting the ...READ MORE

answered Jul 11, 2018 in Jenkins by Sophie may
• 10,550 points
0 votes
1 answer

Jenkins failed to set git

Change to the jenkins user and run the command ...READ MORE

answered Jul 19, 2018 in Jenkins by Kalgi
• 2,680 points
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
0 votes
2 answers

Managing SSH keys within Jenkins for Git

Have you tried logging in as the ...READ MORE

answered Aug 8, 2019 in Jenkins by Sirajul
• 59,090 points
0 votes
3 answers

How can I make Jenkins CI with Git trigger on pushes to master?

To automatically run build on code commit, follow ...READ MORE

answered Aug 7, 2019 in Jenkins by Sirajul
• 59,090 points