We are working on Azure Devops for CI pipeline on Git master branch. We have Version in our pom.xml file, which need to be updated and pushed to the Git back once the build is successful.
For ex:-
<version>0.0.8-SNAPSHOT</version>
in pom.xml
When we runmvn --batch-mode release:prepare release:update-versions -DreleaseVersion=0.0.9 -DpushChanges=true
. it should automatically push the updated version to pom.xml in Git master branch
The above command works perfectly when we run it from our local terminal but fails when we run on azure devops with the following error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.2:prepare (default-cli) on project ap-fds-bua-ccc-api: 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]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
The process '/usr/share/maven/bin/mvn' failed with exit code 1