release branch not deleted => error: 'a release branch already exists. Finish that first'

2,352 views
Skip to first unread message

Dominik Hirt

unread,
Sep 2, 2015, 3:11:45 PM9/2/15
to Maven JGit Flow Plugin
Hi,

I'm using version 1.0-m5.1 within a small bash script around the mvn jgitflow:release-start and mvn jgitflow:release-finish goals...

The first execution runs well and everything is fine. 
But for every subsequent execution, I've got the following error:

[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start (default-cli) on project XYZ: Error starting release: Error starting release: a release branch [refs/heads/release-0.0.1] already exists. Finish that first! -> [Help 1]

> git branch -a
* development
  master
  release-0.0.1
  remotes/origin/development
  remotes/origin/master

The now created release-0.0.1 branch still exists after the successful run of release-finish and together with

com/atlassian/jgitflow/core/util/RequirementHelper.java


    public void requireNoExistingReleaseBranches() throws ReleaseBranchExistsException, JGitFlowGitAPIException
   
{
       
List<Ref> branches = GitHelper.listBranchesWithPrefix(git, gfConfig.getPrefixValue(JGitFlowConstants.PREFIXES.RELEASE.configKey()));
       
if (!branches.isEmpty())
       
{
            reporter
.errorText(commandName, "a release branch [" + branches.get(0).getName() + "] already exists. Finish that first!");
            reporter
.flush();
           
throw new ReleaseBranchExistsException("a release branch [" + branches.get(0).getName() + "] already exists. Finish that first!");
       
}
   
}

the error EVERYTIME occur.

This is my plugin configuration:

                <configuration>

                   <flowInitContext>

                       <masterBranchName>master</masterBranchName>

                       <developBranchName>development</developBranchName>

                       <featureBranchPrefix>feature-</featureBranchPrefix>

                       <releaseBranchPrefix>release-</releaseBranchPrefix>

                       <hotfixBranchPrefix>hotfix-</hotfixBranchPrefix>

                       <versionTagPrefix>release-</versionTagPrefix>

                   </flowInitContext>

                   <username>jenkins</username>

                   <password>admin1</password>

                   <noDeploy>true</noDeploy>

                   <useReleaseProfile>false</useReleaseProfile>

                   <pushReleases>false</pushReleases>

                   <keepBranch>false</keepBranch>

                   <scmCommentPrefix>[jgitflow]</scmCommentPrefix>

               </configuration>


Ok, I can manually delete the release branch created by jgitflow, but is this the intended behaviour ?

Jeffrey Bell

unread,
Sep 2, 2015, 8:28:22 PM9/2/15
to Maven JGit Flow Plugin
Under normal circumstances, the release-start creates the release branch and the release-finish deletes the release branch. Anyway you can post your jgitflow.log file from the release-finish? I would hazard to guess that the release-finish was not completely successful.

Phil Segal

unread,
Oct 15, 2015, 9:14:33 AM10/15/15
to Maven JGit Flow Plugin
I am seeing the same issue. Using 1.0-m5, and running mvn jgitflow:release-start and mvn jgitflow:release-finish, the finish goal completes successfully, the artifacts are getting deployed, but I can see in git that the release branch is not getting merged, nor deleted.

Cedric Teyton

unread,
Apr 27, 2016, 11:44:47 AM4/27/16
to Maven JGit Flow Plugin
Having the same issue here !
Reply all
Reply to author
Forward
0 new messages