3

I am trying to Preform a Maven Release using Jenkins. But I am having some issues. This is my first time doing a Maven Release. Jenkins pulls down my code from the Git repository and changes all the pom files to the correct Version. I can see this my examining the Jenkins workspace. however it does not seem to be pushing the changes back up to the Git repo with the version changed. Git uses a code review tool call Gerrit that I should have to approve once it preforms the mvn release.

I have set SCM in my main POM <scm><developerConnection>scm:git:ssh://<user>@<IP_Address>:<Port>/<Repo_Name>.git</developerConnection></scm>

I am getting a error

Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.0:prepare (default-cli) on project <Name>: An error is occurred in the checkin process: Exception while executing SCM command. cause : An error is occurred in the checkin process: Exception while executing SCM command. Stack trace : .....

Any ideas?

3
  • Have you something more detailed to show ? You can create a Gist or pastebin to give us more context. Jun 3, 2013 at 14:51
  • does this help pastebin.com/raw.php?i=Hr4meuUk Jun 3, 2013 at 15:12
  • Do you still have the same problem? I have the same problem and I would like to know how to fix Feb 25, 2014 at 15:07

1 Answer 1

1

Thanks for the pastebin.

The error Caused by: org.apache.maven.scm.ScmException: Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref can often be tricked by setting Checkout/merge to local branch (optional) to master (if you're releasing master) in section Advanced... of Git parameter.

2
  • How do I tell it to create a new branch and push up to Gerrit and the Git repo? Jun 3, 2013 at 15:35
  • Maven release:prepare and release:perform will only modify the branch you're currently releasing. If you want to create a new branch, you may add a build step Execute shell with few git commands (git checkout -b new-branch old-branch; git push gerrit new-branch;...) Jun 3, 2013 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.