Skip to content

Commit 388ca8b

Browse files
committed
Resolve issue #24
Do not treat 'bugfix' as a magical branch, it's just an identifier of a 'feature'. This works out quite well thanks to the recently added support for UNDEFINED branch types.
1 parent 906407b commit 388ca8b

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<groupId>com.e-gineering</groupId>
1010
<artifactId>gitflow-helper-maven-plugin</artifactId>
1111

12-
<version>1.2.2</version>
12+
<version>1.2.3</version>
1313
<packaging>maven-plugin</packaging>
1414

1515
<name>gitflow-helper-maven-plugin</name>

src/main/java/com/e_gineering/maven/gitflowhelper/AbstractGitflowBranchMojo.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ public abstract class AbstractGitflowBranchMojo extends AbstractMojo {
3535
@Parameter(defaultValue = "origin/hotfix/(.*)", property = "hotfixBranchPattern", required = true)
3636
private String hotfixBranchPattern;
3737

38-
@Parameter(defaultValue = "origin/bugfix/.*", property = "bugfixBranchPattern", required = true)
39-
private String bugfixBranchPattern;
40-
4138
@Parameter(defaultValue = "origin/development", property = "developmentBranchPattern", required = true)
4239
private String developmentBranchPattern;
4340

@@ -94,8 +91,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
9491
logExecute(GitBranchType.RELEASE, gitBranch, releaseBranchPattern);
9592
} else if (gitBranch.matches(hotfixBranchPattern)) {
9693
logExecute(GitBranchType.HOTFIX, gitBranch, hotfixBranchPattern);
97-
} else if (gitBranch.matches(bugfixBranchPattern)) {
98-
logExecute(GitBranchType.BUGFIX, gitBranch, bugfixBranchPattern);
9994
} else if (gitBranch.matches(developmentBranchPattern)) {
10095
logExecute(GitBranchType.DEVELOPMENT, gitBranch, developmentBranchPattern);
10196
} else {

src/main/java/com/e_gineering/maven/gitflowhelper/AttachDeployedArtifactsMojo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ protected void execute(GitBranchType type, String gitBranch, String branchPatter
2222
break;
2323
}
2424
case RELEASE:
25-
case HOTFIX:
26-
case BUGFIX: {
25+
case HOTFIX: {
2726
getLog().info("Attaching artifacts from stage repository...");
2827
attachExistingArtifacts(stageDeploymentRepository, true);
2928
break;

src/main/java/com/e_gineering/maven/gitflowhelper/EnforceVersionsMojo.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.apache.maven.plugins.annotations.LifecyclePhase;
77
import org.apache.maven.plugins.annotations.Mojo;
88

9-
import java.util.EnumSet;
109
import java.util.regex.Matcher;
1110
import java.util.regex.Pattern;
1211

@@ -17,11 +16,9 @@
1716
@Mojo(name = "enforce-versions", defaultPhase = LifecyclePhase.VALIDATE)
1817
public class EnforceVersionsMojo extends AbstractGitflowBranchMojo {
1918

20-
private static EnumSet<GitBranchType> versionedTypes = EnumSet.of(GitBranchType.MASTER, GitBranchType.RELEASE, GitBranchType.HOTFIX, GitBranchType.BUGFIX);
21-
2219
@Override
2320
protected void execute(final GitBranchType type, final String gitBranch, final String branchPattern) throws MojoExecutionException, MojoFailureException {
24-
if (versionedTypes.contains(type)) {
21+
if (GitBranchType.VERSIONED_TYPES.contains(type)) {
2522
getLog().debug("Versioned Branch Type: " + type + " with branchPattern: " + branchPattern + " Checking against current branch: " + gitBranch);
2623
Matcher gitMatcher = Pattern.compile(branchPattern).matcher(gitBranch);
2724

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
package com.e_gineering.maven.gitflowhelper;
22

3+
import java.util.EnumSet;
4+
35
/**
46
* Enum for different types of Git Branches...
57
*/
68
public enum GitBranchType {
79
MASTER,
810
RELEASE,
911
HOTFIX,
10-
BUGFIX,
1112
DEVELOPMENT,
1213
OTHER,
1314
UNDEFINED;
15+
16+
static EnumSet<GitBranchType> VERSIONED_TYPES = EnumSet.of(GitBranchType.MASTER, GitBranchType.RELEASE, GitBranchType.HOTFIX);
1417
}

0 commit comments

Comments
 (0)