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,080 points
316 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
• 37,320 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,100 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,900 points
1,347 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
36 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,370 points
221 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
127 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Managing SSH keys within Jenkins for Git

The github.com host which Jenkins tries to ...READ MORE

answered Aug 9, 2018 in Jenkins by Kalgi
• 37,320 points
309 views
0 votes
2 answers

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

Generic webhook trigger can be useful When configured ...READ MORE

answered Aug 13, 2018 in Jenkins by lina
• 8,100 points
86 views