Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ It's really simple to setup this plugin; below is a sample pom that you may base
<!-- example: apply replacement only to the specific property git.branch and replace '/' with '-'
<replacementProperty>
<property>git.branch</property>
<propertyOutputSuffix>something<propertyOutputSuffix>
<propertyOutputSuffix>something</propertyOutputSuffix>
<token>^([^\/]*)\/([^\/]*)$</token>
<value>$1-$2</value>
<regex>true</regex>
Expand Down
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,15 @@
<replacementProperties>
<replacementProperty>
<property>git.branch</property>
<propertyOutputSuffix>something</propertyOutputSuffix>
<token>^([^\/]*)\/([^\/]*)$</token>
<value>$1-$2</value>
<transformationRules>
<transformationRule>
<apply>BEFORE</apply>
<action>UPPER_CASE</action>
</transformationRule>
</transformationRules>
</replacementProperty>
</replacementProperties>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/pl/project13/maven/git/TransformationRule.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@ public String getApply() {
}

public void setApply(String apply) {
this.applyRule = ApplyEnum.valueOf(apply);
this.apply = apply;
}

public ApplyEnum getApplyRule() {
if(applyRule == null) {
throw new IllegalStateException("The parameter 'apply' for TransformationRule is missing or invalid");
}
return applyRule;
}

Expand All @@ -101,10 +105,14 @@ public String getAction() {
}

public void setAction(String action) {
this.actionRule = ActionEnum.valueOf(action);
this.action = action;
}

public ActionEnum getActionRule() {
if(actionRule == null) {
throw new IllegalStateException("The parameter 'action' for TransformationRule is missing or invalid");
}
return actionRule;
}
}