ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <>
Subject Re: Reusing property values in a properties file
Date Sun, 11 Jul 2010 06:55:46 GMT
It would be nice if you posted some code explaining how all of this works.

You cannot change a property value, but of course, you can reuse it as
many times as you want to set other properties. That is, if you define
a property user, it could be used to set the other properties. All you
have to do is surround the name with curly braces and prepend it with
a dollar sign:


I'm assuming you're using a filter task. Yes, your filter file should
look like this:


The filter will change the first line to the correct string value. Or,
you can do it like this:


The filter will replace all instances.

On Sat, Jul 10, 2010 at 9:38 PM, anindya.mukherjee
<> wrote:
> I am using ant in my project as follows. I have templates of all environment
> files in our application.
> These templates have properties with placeholders in them like ->
> For each environment we have a properties file. Like for dev we have
> This contains the actual value of the property like ->
> We call ant like this -> ant create -Denv=dev
> The ant build file has this create task which uses the property values from
> the properties file to fill in the templates.
> Now the question is , there are several properties that I reuse in the
> properties file. Like the directory name . Is there any way I can reuse the
> properties in the properties file like ( I am doing ant build in windows
> boxes ) ->
> In -->
> USER_NAME=batuser
> --
> View this message in context:
> Sent from the Ant - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

David Weintraub

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

View raw message