Skip to content

Commit 8440146

Browse files
author
TheSnoozer
authored
Merge pull request #329 from TheSnoozer/master
Minor fixes for #317
2 parents 6557ed6 + dda1a6b commit 8440146

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ It's really simple to setup this plugin; below is a sample pom that you may base
371371
<!-- example: apply replacement only to the specific property git.branch and replace '/' with '-'
372372
<replacementProperty>
373373
<property>git.branch</property>
374-
<propertyOutputSuffix>something<propertyOutputSuffix>
374+
<propertyOutputSuffix>something</propertyOutputSuffix>
375375
<token>^([^\/]*)\/([^\/]*)$</token>
376376
<value>$1-$2</value>
377377
<regex>true</regex>

pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,15 @@
386386
<replacementProperties>
387387
<replacementProperty>
388388
<property>git.branch</property>
389+
<propertyOutputSuffix>something</propertyOutputSuffix>
389390
<token>^([^\/]*)\/([^\/]*)$</token>
390391
<value>$1-$2</value>
392+
<transformationRules>
393+
<transformationRule>
394+
<apply>BEFORE</apply>
395+
<action>UPPER_CASE</action>
396+
</transformationRule>
397+
</transformationRules>
391398
</replacementProperty>
392399
</replacementProperties>
393400
<failOnNoGitDirectory>false</failOnNoGitDirectory>

src/main/java/pl/project13/maven/git/TransformationRule.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,14 @@ public String getApply() {
8989
}
9090

9191
public void setApply(String apply) {
92+
this.applyRule = ApplyEnum.valueOf(apply);
9293
this.apply = apply;
9394
}
9495

9596
public ApplyEnum getApplyRule() {
97+
if(applyRule == null) {
98+
throw new IllegalStateException("The parameter 'apply' for TransformationRule is missing or invalid");
99+
}
96100
return applyRule;
97101
}
98102

@@ -101,10 +105,14 @@ public String getAction() {
101105
}
102106

103107
public void setAction(String action) {
108+
this.actionRule = ActionEnum.valueOf(action);
104109
this.action = action;
105110
}
106111

107112
public ActionEnum getActionRule() {
113+
if(actionRule == null) {
114+
throw new IllegalStateException("The parameter 'action' for TransformationRule is missing or invalid");
115+
}
108116
return actionRule;
109117
}
110118
}

0 commit comments

Comments
 (0)