Explain how to modify properties in ANT

Explain how to modify properties in ANT.

We can not modify the properties in ant. The properties in ant are immutable in nature.

Explain how to modify properties in ant.

Ant properties are immutable; they cannot be changed once initialized. However, it can be done in the following way although it causes the immutable property violation:
<?xml version="1.0"?>
<project name="example" default="run">
   <taskdef name="groovy"
        classname="org.codehaus.groovy.ant.Groovy"
        classpath="lib/groovy-all-1.1-rc-1.jar"/>

   <target name="run">
    <echo>java.library.path = ${java.library.path}
   <groovy>
     properties["java.library.path"] = "changed"
   </groovy>
    <echo>java.library.path = ${java.library.path}
   </target>
</project>
Explain how to use Runtime in ANT
Explain how to use Runtime in ANT - There is no need to use Runtime in ant. Because ant has Runtime counterpart by name ExecTask...
How can I use ANT to run a Java application?
How can I use ANT to run a Java application? - The following is an example to run a java application in using ant:...
Explain how to debug my ANT script
Explain how to debug my ANT script - Ant script can be debugged in the following ways: By echoing at the place to debug. The problem is easily known. This is similar to printf () function in C and System.out.println() in Java....
Post your comment