ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harkness, David" <>
Subject RE: Optional jvmargs ???
Date Wed, 03 Sep 2003 21:06:35 GMT
Hi Rob,

I can't help with the first part of your question, but I can address the
second part. Ant properties are immutable -- the first value they get
assigned is permanent. Thus, you can set the default value in a
<property> task in your build.xml file, and any value the user provides
will override the file's value.

I took it a step farther here. The project's main configuration
properties (debug mode, whether or not to compile tests with the code,
use local or released JARs, etc) are in Each
environment can override these in build_<env>.properties. And finally,
the developer can override those by creating
The top of the build.xml file reads in the properties:

    <property file=""/>
    <property file="build_${env}.properties"/>
    <property file=""/>

Thus, developer properties override environment properties which
override project properties.

So far this has been flexible enough for our projects. The one (most
important) thing it's missing in my view is a level of indirection.
Instead of setting properties for each environment -- duplicating them
where two environments are identical -- the environment should dictate a
configuration file. Thus, the "dev" and "qa" environments would both
specify the "basic" configuration while "stage" and "prod" would use the
"resource-hog" setup.

David Harkness
Sr. Software Engineer
Sony Pictures Digital Networks
(310) 482-4756

-----Original Message-----
From: Rob [] 
Sent: Wednesday, September 03, 2003 1:43 PM
Subject: Optional jvmargs ???

Dear All,

Am new to Ant and trying to define optional JVMARGs only when arguments
have been passed on the Ant command line by the user:

<jvmarg value="-Dopt.1=${opt.1}" if="opt.1" />

...but I get the error:

build.xml:253: Class$Argument
doesn't support the "if" attribute.

This is Ant version 1.5.1.  I tried out version 1.5.4 and got the same

Found the 'jvmarg if=' example in...

...and the jvmargset that they were using doesn't work either.  Is this
an extension?

Would also like to define default JVM arguments which can be overridden
by the user; for example:

<property name="myDefault" value="1" />
   <jvmarg value="-DmyDefault=${myDefault}" />

What's the rules of precedence on passed-in Ant arguments versus
properties defined in build.xml?

Lowly Consultant, NYC

Want to chat instantly with your online friends?  Get the FREE Yahoo!

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

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

View raw message