@@ -49,6 +49,13 @@ public class GitFlowSupportStartMojo extends AbstractGitFlowMojo {
4949 @ Parameter (property = "tagName" )
5050 private String tagName ;
5151
52+ /**
53+ * Branch name to use instead of the default.
54+ *
55+ */
56+ @ Parameter (property = "supportBranchName" )
57+ private String supportBranchName ;
58+
5259 /** {@inheritDoc} */
5360 @ Override
5461 public void execute () throws MojoExecutionException , MojoFailureException {
@@ -91,25 +98,28 @@ public void execute() throws MojoExecutionException, MojoFailureException {
9198 throw new MojoFailureException ("Tag is blank." );
9299 }
93100
101+ String branchName = tag ;
102+ if (StringUtils .isNotBlank (supportBranchName )) {
103+ branchName = supportBranchName ;
104+ }
105+
94106 // git for-each-ref refs/heads/support/...
95- final boolean supportBranchExists = gitCheckBranchExists (gitFlowConfig
96- .getSupportBranchPrefix () + tag );
107+ final boolean supportBranchExists = gitCheckBranchExists (gitFlowConfig .getSupportBranchPrefix () + branchName );
97108
98109 if (supportBranchExists ) {
99- throw new MojoFailureException (
100- "Support branch with that name already exists." );
110+ throw new MojoFailureException ("Support branch with that name already exists." );
101111 }
102112
103113 // git checkout -b ... tag
104- gitCreateAndCheckout (gitFlowConfig .getSupportBranchPrefix () + tag , tag );
114+ gitCreateAndCheckout (gitFlowConfig .getSupportBranchPrefix () + branchName , tag );
105115
106116 if (installProject ) {
107117 // mvn clean install
108118 mvnCleanInstall ();
109119 }
110120
111121 if (pushRemote ) {
112- gitPush (gitFlowConfig .getSupportBranchPrefix () + tag , false );
122+ gitPush (gitFlowConfig .getSupportBranchPrefix () + branchName , false );
113123 }
114124 } catch (CommandLineException e ) {
115125 throw new MojoFailureException ("support-start" , e );
0 commit comments