'Unable to send argument or receive output from ant java task having curly braces in values
I need to call a java task in ant script which returns a value , which I would be needing in subsequent tasks
The Java task StringParser requires an argument with curly braces eg "input{textABC}" and should produce output in curly braces as well eg "output{textXYZ}" but I am getting out put as "textXYZ" rather than "output{textXYZ}"
Same goes for argument, need to pass "input{textABC}" but able to send "textABC"
Ant script:
<property name="inputValue" value="input{textABC}">
<echo> Input $value </echo>
<target name="run">
<java classname="StringParser" outputproperty="parsedValue">
<arg line="${inputValue}" />
</java>
<echo> Ouput $parsedValue </echo>
</target>
Java class:
public class StringParser {
public static void main(final String[] args) throws Exception {
String input = args[0];
output="output{sample}";
System.out.println(output);
}
}
Not sure how to achieve this, it seems java task is unable to recognize { as value string
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
