Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting error while running bitbucket-pipeline using mvn release:prepare release:perform

Kulbhushan Mayer June 24, 2017

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

1 answer

0 votes
SebC
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 9, 2017

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events