Error starting release: a release branch.. already exists | error while starting the release

5,979 views
Skip to first unread message

Sudhakar Shanmugam

unread,
Apr 16, 2014, 6:57:50 AM4/16/14
to maven-jgit...@googlegroups.com
Hello -

We were using SVN and recently migrated to GIT. So to release the projects from GIT repo, I am trying to use jgitflow-maven-plugin version 1.0-m1 to release the projects off of GIT repo.

We are following the "git flow" work flow and i would like to release the project off of develop branch. I created a branch "release-test" from develop branch and trying to release it. When i do a release my understanding is that from branch "release-test" it should do the following:-
 - runs a maven build (deploy or install)
 - merges the release branch to develop
 - updates pom(s) with development versions in the develop branch

Below are the logs from my console and any help is highly appreciated.

Thanks,
Sudhakar


------------------------------------------------------------------------------------------------------------------------------------------------
$ git checkout release-test
Switched to branch 'release-test'
------------------------------------------------------------------------------------------------------------------------------------------------

$ mvn jgitflow:release-start
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building PRODUCT Features 1.3.3-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- jgitflow-maven-plugin:1.0-m1:release-start (default-cli) @ PRODUCTNAME-features ---
[INFO] detected cygwin:
[INFO]     - turning off filemode...
[INFO]     - fixing maven prompter...
[INFO] Checking for SNAPSHOT version in projects...
[INFO] Checking dependencies and plugins for snapshots ...
[INFO] ensuring origin exists...
What is the release version for "PRODUCT Features"? (com.pearson.ltg.PRODUCT:PRODUCTNAME-features) [1.3.3]:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.605s
[INFO] Finished at: Wed Apr 16 06:39:05 EDT 2014
[INFO] Final Memory: 13M/981M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m1:release-start (default-cli) on project PRODUCTNAME-features: Error starting release: Error starting release: a release branch [refs/heads/release-test] already exists. Finish that first! -> [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

------------------------------------------------------------------------------------------------------------------------------------------------

$ git branch -a
* develop
  master
  release-test
  remotes/origin/develop
  remotes/origin/master



Jonathan Doklovic

unread,
Apr 16, 2014, 2:36:16 PM4/16/14
to maven-jgit...@googlegroups.com
Hi,

You can't start a release from an existing branch. Instead you start a release from develop and the plugin will create the release branch for you.

So instead of doing 'git checkout release-test' and then doing 'mvn jgitflow:release-start' you need to checkout develop, make sure you do not have any existing branches with the same name as your release branch, and then do 'mvn jgitflow:release-start'.

It will prompt you for the release branch name, do everything it needs to including creating the branch, and then will checkout the new release branch for you.

- Jonathan

Sudhakar Shanmugam

unread,
Apr 17, 2014, 12:07:24 PM4/17/14
to maven-jgit...@googlegroups.com

Sudhakar Shanmugam

unread,
Apr 17, 2014, 12:16:16 PM4/17/14
to maven-jgit...@googlegroups.com
Thanks Jonathan.

I tried running 'git checkout release-test' after switching to develop branch. During the prompt if I give a name it is being used to create the release branch which is good but it is updating the pom version as well. Is there a way i can mention the branch name without affecting the pom version? For example the project I want to release is having a version "1.4.0-SNAPSHOT" and I want the release branch to be created as "release/release-1.2" and not as "release/1.4.0".

And it would be really help to understand the work flow of the plugin comparing with "git workflow". Below I have summarized the "git workflow".
 - Creating this branch starts the next release cycle
 - Once it's ready to ship, the release gets merged into master
 - it should be merged back into develop

When using the "jgit release plugin", below is what it is happening.
- Creating release-branch off of develop
- merged the changes on the release-branch to develop and updates the pom version to the next development version

So we need to merge the changes from develop branch to master?

Thanks again for your help & appreciate it.

Regards,
Sudhakar



On Wednesday, April 16, 2014 2:36:16 PM UTC-4, Jonathan Doklovic wrote:

Sudhakar Shanmugam

unread,
Apr 18, 2014, 1:32:21 AM4/18/14
to maven-jgit...@googlegroups.com
Here is my plugin configuration in my pom.xml

            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0-m1</version>
                <dependencies>
                    <dependency>
                        <groupId>external.atlassian.jgitflow</groupId>
                        <artifactId>jgitflow-maven-plugin</artifactId>
                        <version>1.0-m1</version>
                    </dependency>
                </dependencies>           
                <configuration>
                    <prefixes>
                        <masterBranch>master</masterBranch>
                        <developBranch>develop</developBranch>
                        <featureBranchPrefix>feature/</featureBranchPrefix>
                        <releaseBranchPrefix>release/</releaseBranchPrefix>
                        <hotfixBranchPrefix>hotfix/</hotfixBranchPrefix>
                        <supportBranchPrefix>support/</supportBranchPrefix>
                        <versionTagPrefix>v-</versionTagPrefix>
                    </prefixes>
                    <msgPrefix>[jgitflow-maven-plugin]</msgPrefix>
                    <enableFeatureVersions>true</enableFeatureVersions>
                    <pushFeatures>true</pushFeatures>
                    <pushReleases>true</pushReleases>
                    <pushHotfixes>true</pushHotfixes>
                    <pushSupport>true</pushSupport>
                    <skipBuild>false</skipBuild>
                    <skipDeploy>false</skipDeploy>
                    <skipTests>false</skipTests>
                </configuration>
            </plugin>
Reply all
Reply to author
Forward
0 new messages