aleksandr-m / gitflow-maven-plugin

The Git-Flow Maven Plugin supports various Git workflows, including GitFlow and GitHub Flow. This plugin runs Git and Maven commands from the command line.
https://aleksandr-m.github.io/gitflow-maven-plugin/
Apache License 2.0
493 stars 181 forks source link

Cant finish feature due to "Feature branch with name 'feature-xxx' doesn't exist. Cannot finish feature." #243

Closed HenningL closed 4 years ago

HenningL commented 4 years ago

The checked out branch is exactly the mentioned one "feature-xx" or "feature/xxx", both exist and being built.

The finish goal nevertheless is telling me that this branch doesnt exist. I also can see the branches in the workspace so i dont get why the plugin thinks , it is not there.

mvn clean -X gitflow:feature-finish -DfeatureName=developmentIntegrationTest -DpullDevelop=true -DscmCommentPrefix=[Merge] -DpushFeatures=true

Caused by: org.apache.maven.plugin.MojoFailureException: Feature branch with name 'feature-developmentIntegrationTest' doesn't exist. Cannot finish feature. at com.amashchenko.maven.plugin.gitflow.GitFlowFeatureFinishMojo.execute (GitFlowFeatureFinishMojo.java:109)

aleksandr-m commented 4 years ago

@HenningL Does it work without setting -DfeatureName? Have you changed feature prefix?

HenningL commented 4 years ago

@aleksandr-m hi. the featureName is mandatory. i checked the workspace and the refs/heads , which gets checked, didnt exist since i didnt configure the checkout to create a local branch, it seems. i never needed that.

i changed my jenkins pipeline to create a local branch and now i have the refs/heads/.... in the workspace.

scmVars = checkout([ $class: 'GitSCM', branches: [ [name: 'refs/heads/' + env.BRANCH_NAME] ], extensions: [ [$class: 'CloneOption', honorRefspec:true, noTags: false, shallow: false, depth: 0], [$class: 'LocalBranch'] ], userRemoteConfigs: scm.userRemoteConfigs, ])