ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject Re: Search for properties file in parent directories
Date Thu, 11 Nov 2010 17:07:07 GMT
On Thu, Nov 11, 2010 at 4:33 AM, Ludwig, Michael
<> wrote:
> On the command line, I can instruct ant to go searching for a build
> file by climbing up the directory tree: [...]
> From within a script, I can instruct ant to load properties from a
> file using <property file=""/>.
> Is there a way to instruct Ant to go searching for the properties
> file by climbing up the directory tree, just like "ant -s" does for build files?

As Antoine already mentioned, not for an arbitrarily-deep hierarchy,
and not without contorsions.

But may I inquire why you need that? In my experience, properties
files are in known locations, either absolute, or more likely relative
to the "basedir", or some file.

For example, If in your case the .properties is in config/ relative to
the build.xml that would found via the -s CLI switch, you can load the
properties file using <property file="${basedir}/config/"
/>, whereas <property file="" /> uses either ${basedir}
or the current directory (I don't remember which).

Just a guess as to the motivation behind your question ;) --DD

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

View raw message