Java ANT Question:
Download Questions PDF

Do you know 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"

<target name="run">
<echo>java.library.path = ${java.library.path}</echo>
properties["java.library.path"] = "changed"
<echo>java.library.path = ${java.library.path}</echo>

Download ANT Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me how to start to use Ant and provide a "Hello World" ant script?Tell me how does ant read properties? How to set my property system?