Skip to content

Commit b2b10af

Browse files
committed
The low hanging fruit.
1 parent cbcf0bd commit b2b10af

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ plugins in the build process (deploy, site-deploy, etc.) will use the repositori
203203
| releaseDeploymentRepository | n/a | The repository to use for releases. (Builds with a GIT_BRANCH matching `masterBranchPattern` or `supportBranchPattern`) |
204204
| stageDeploymentRepository | n/a | The repository to use for staging. (Builds with a GIT_BRANCH matching `releaseBranchPattern` or `hotfixBranchPattern`) |
205205
| snapshotDeploymentRepository | n/a | The repository to use for snapshots. (Builds matching `developmentBranchPattern`) |
206-
| otherDeploymentBranchPattern | false | N/A | Regex. When matched, the branch name is normalized and any artifacts produced by the build will include the normalized branch name and -SNAPSHOT. Deployment will target the snapshot repository|
206+
| otherDeploymentBranchPattern | n/a | Regex. When matched, the branch name is normalized and any artifacts produced by the build will include the normalized branch name and -SNAPSHOT. Deployment will target the snapshot repository |
207207

208208
**The repository properties should follow the following format**, `id::layout::url::uniqueVersion`.
209209

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,12 @@ protected void execute(final GitBranchInfo gitBranchInfo) throws MojoExecutionEx
3535
break;
3636
}
3737
case OTHER: {
38-
// If other branches are set to deploy
39-
// Other branches never target release, but may target stage for non-SNAPSHOT artifacts.
40-
// For this reason, "overwrite" is considered _highly_ dangerous.
4138
String otherBranchesToDeploy = resolveExpression(otherDeployBranchPattern);
4239
if (!"".equals(otherBranchesToDeploy) && gitBranchInfo.getName().matches(otherBranchesToDeploy)) {
4340
setTargetSnapshots();
4441

4542
String branchName = gitBranchInfo.getName();
46-
String semVerAddition = "+" + branchName.replaceAll("[^0-9^A-Z^a-z^-^.]", "-") + "-SNAPSHOT";
43+
String semVerAddition = "+" + branchName.replaceAll("[^0-9A-Za-z-.]", "-") + "-SNAPSHOT";
4744

4845
updateArtifactVersion(project.getArtifact(), semVerAddition);
4946
for (Artifact a : project.getAttachedArtifacts()) {

src/test/resources/project-alt1-stub/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<releaseBranchProperties>
5757
<foo>bar</foo>
5858
</releaseBranchProperties>
59-
<otherDeployBranchPattern>(origin/)feature/poc/.*</otherDeployBranchPattern>
59+
<otherDeployBranchPattern>(origin/)?feature/poc/.*</otherDeployBranchPattern>
6060
</configuration>
6161
<executions>
6262
<execution>

0 commit comments

Comments
 (0)