I want to pass “;;;” string as a string parameter in my Ant task:
<mytask param=";;;"/>
but Ant consider semicolon as a special symbol and raises an error
java.lang.IllegalArgumentException: Illegal group reference
how can I escape ; symbol to pass it to Ant?
p.s. also I found that I can’t pass { symbol,
so I wonder what’s the common way to escape characters in Ant?
I’ve tried “$;$;$;” but it’s not working for me
UPDATE:
sample code:
public class MyTask extends Task {
private String value;
public void setValue(String value) {
this.value = value;
}
public void execute() {
System.out.println(value);
}
}
and ant task:
<taskdef name="mytask" classpath="build/lib/CustomTasks.jar"
classname="MyTask"/>
<mytask value=";;;"/>
I have not any problem with this sample:
Output:
May be problem in implementation of
mytasktask?