We're updating the issue view to help you get more done. 

UberWar: dollar sign in value breaks NodeMerge strategy

Description

UberWar is unable to merge nodes when one of the values to be used in merge contains dollar sign.

Sample configuration:

1 2 3 4 5 6 <strategy name="NodeMerge"> <context-param> <param-name>$left:param-name</param-name> <param-value>$left:param-value $right:param-value</param-value> </context-param> </strategy>

Sample value:

1 2 3 4 <context-param> <param-name>param-dollar</param-name> <param-value>${value1}</param-value> </context-param>

Exception:

[INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------ [INFO] Merging exception creating UBERWAR

Embedded error: Exception merging web.xml files
Illegal group reference
[INFO] ------------------------------------------------------------------------ [INFO] Trace
.....
Caused by: java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:713)
at java.util.regex.Matcher.replaceFirst(Matcher.java:861)
at org.codehaus.cargo.module.merge.tagstrategy.NodeMergeStrategy.applyValues(NodeMergeStrategy.java:154)
at org.codehaus.cargo.module.merge.tagstrategy.NodeMergeStrategy.applyValues(NodeMergeStrategy.java:140)
at org.codehaus.cargo.module.merge.tagstrategy.NodeMergeStrategy.applyValues(NodeMergeStrategy.java:140)
at org.codehaus.cargo.module.merge.tagstrategy.NodeMergeStrategy.inBoth(NodeMergeStrategy.java:92)
at org.codehaus.cargo.module.merge.tagstrategy.AbstractChoiceMergeStrategy.inBoth(AbstractChoiceMergeStrategy.java:61)
at org.codehaus.cargo.module.merge.DescriptorMergerByTag.merge(DescriptorMergerByTag.java:194)
... 24 more

Status

Assignee

Anton Khitrenovich

Reporter

S. Ali Tokmen

Components

Fix versions

Affects versions

1.1.1

Priority

Minor