ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Rich" <>
Subject RE: change to a property
Date Sat, 31 Jul 2004 15:59:47 GMT
Properties are immutable so you can not change them once they are set.  But,
you can specify the value multiple times so that only the first one will
take effect.  You can specify the value of a property on the command line
(-Dprop=value).  This will be the first setting of the property so no other
settings in the ant file will override it.

Or if you can't/won't specify it on the command line you may need some extra
code to determine which one you want to set in the ant file.  You could test
to see if an environment var is set and use it or use a default value.

I generally use a three tier approach --
1. Set from the command line
2. Set from a .properties file loaded by the ant file (before any other
target gets control)
3. Set default value in the ant file

Bill Rich
Wilandra Consulting LLC
1325 Addiewell Place
San Jose, CA  95120-3905
phone:      +1 408 268-2452
mobile:     +1 408 410-9713
Santa Cruz: +1 831 464-9007
fax:        +1 413 669-9716 or

-----Original Message-----
From: [] 
Sent: Saturday, July 31, 2004 4:14 AM
To: Ant Users List
Subject: change to a property

I have a situation where a default value of a property should be overwritten
I was contemplating pegging the property to an environment variable but
couldnt find a working example Does anyone have an example of a property
which changes because of an environment variable change and how to implement
this ???

To unsubscribe, e-mail: For additional
commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message