I am using Maven 3.9 and am writing our CICD bitbucket pipelines.
The script executes these commands:
mvn -B release:prepare
mvn -B release:perform
This updates the project-version
in the pom.xml and creates a git tag.
e.g. git tag
notification-service-0.0.1
notification-service-0.0.2
notification-service-0.0.3
pom.xml
<scm>
<connection>scm:git:ssh://[email protected]/xxxx/notification-service.git</connection>
<developerConnection>scm:git:ssh://[email protected]/xxxx/notification-service.git</developerConnection>
<url>ssh://[email protected]/xxxx/notification-service</url>
<tag>HEAD</tag>
</scm>
Question
Should this also be creating a branch too?
The reason I ask, is the mvn -B release:perform
gets the following error, because the branch does not exist:
fatal: Remote branch notification-service-0.0.3 not found in upstream origin
I thought it would commit the updated code to the existing branch, e.g. main
branch, not the notification-service-0.0.3
branch. Or is it supposed to create a new branch for each release?
We have been using a generic branch called release
, but perhaps our git flow model is incorrect?