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
org.apache.maven.plugins:maven-release-plugin:2.3.2(default-cli)
projectFailed ch.apkern.achilles:parent:1.0-SNAPSHOT  sessionEnded
Aug 6, 2018 in Jenkins by Hannah
• 14,090 points
433 views

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
• 40,540 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,110 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
• 6,880 points
1,616 views
0 votes
1 answer

sonar XML plugin installation failure in jenkins

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

answered Jun 20, 2018 in Jenkins by Atul
• 10,240 points
46 views
0 votes
1 answer

Jenkins: Build Pipeline Plugin Scheduled Trigger

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

answered Jul 10, 2018 in Jenkins by Sophie may
• 9,530 points
388 views
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,620 points
297 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
152 views
0 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 in Jenkins by Sirajul
• 26,400 points
421 views
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 in Jenkins by Sirajul
• 26,400 points
150 views