ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <>
Subject Re: Set a default value to property.
Date Tue, 30 Nov 2010 19:44:36 GMT
On Tue, Nov 30, 2010 at 2:04 PM, ritchie <> wrote:
> My ant script takes a value for a property at runtime(-Denv=xxx), if the
> argument is not passed i want the value to be set as a default arbitary
> value. How to accomplish this?

What do you mean "arbitrary" value? Do you mean some value that you
chose, or it should chose some value on its own, either from a list or
at random?

If you simply want a default property, just set a property in your build.xml.

There's a hierarchy of where property values are set. If you include a
properties file, the values there override whatever values you set in
the build.xml itself, and values from the command line overrided
values set in both the build.xml and property files.

I do this all the time:

    <!-- Will be set if user didn't specify -Denv=xxx from the command line -->
    <property name="env"  value="some_value"/>

David Weintraub

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

View raw message