ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Creech <>
Subject How to Customize Relative Paths Read From Properties File
Date Thu, 27 Apr 2006 15:39:35 GMT

I want to read some relative path elements from the contents of a properties
file, and then create custom absolute paths from these elements by using a
different directory then the base directory(which is what ANT wants to add).

For example, if we had a properties file with:


I'd want to generate the equivalent to:

<path id="compile.classpath">
   <pathelement location="${local.dir}/lib/mylib1.jar" />
   <pathelement location="${local.dir}/lib/mylib2.jar" />
   <pathelement location="${repository.dir}/bos-utils.jar" />
   <pathelement location="${repository.dir}/junit.jar" />

where I prepend '${local.dir}/lib' and '${repository.dir}' to each path
element read.

Something that is close to doing the right thing is:

<path id="compile.classpath">
   <pathelement path="${local.compile.libs}" />
   <pathelement path="${repository.compile.libs}" />

but the problem is that ANT will make these absolute paths
based on base directory, which isn't what is desired.

Is there some simple way to do this? Do I have to write a custom task?
View this message in context:
Sent from the Ant - Users forum at

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

View raw message