Hi Team,
I am getting below error while running "mvn release:prepare release:perform" using bitbucket pipelines. Could you please suggest how to resolve the same?
"[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4:prepare (default-cli) on project my-webapp: An error is occurred in the checkin process: Exception while executing SCM command. Detecting the current branch failed: fatal: ref HEAD is not a symbolic ref -> [Help 1]["
Thanks!
Kulbhushan Mayer
Hey Kulbushan,
Pipelines checks out a specific revision/commit when it runs to help test each change to a project, leaving the working copy in "detached head" mode. Maven wants to make additional commits to your repo to record the changes to your pom.xml, and so must be on a branch.
At the beginning of your pipeline you'll want to reset the branch you want to release from, to the current commit. Assuming you're working from master, you would add
```
#!bash
git checkout master
```
From here you'll be on head: master, and able to run maven release.
Please be aware that your release will fail if not running on the latest commit.
-Seb
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.