ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: What is the best way to set up a class path variable?
Date Thu, 10 Aug 2000 15:17:52 GMT
Both your solutions (using a <property> outside of <target> or in a
common <target>) will work - or not.

<property> is always global - nest it into a <target>, it will still
be global and visible to all tasks. Even worse, only the very first
<property> for a given name is ever considered, all others are
silently ignored - so you can't have two different values in different
targets (at least not without spawning another <ant> task to process
the file again).

Given that, I'd go with the global <property> way, as it doesn't even
look as if the <property> was set at runtime.

And to show you a way that doesn't work with Ant 1.1 but will be
possible in the next release:

  <classpath ID="my.classpath">
    <pathelement location="path/one" />
    <pathelement location="path/two" />
    <pathelement location="path/ten" />

  <classpathref refid="my.classpath" />



View raw message