I'm defining a build.xml file and I need to read some paths from a properties file. Reading from it is ok on my defined targets. The problem comes when I try to read the values inside my taskdef. How can I achieve this?
I have something like this:
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath>
<fileset dir="${paths.jaxb.lib}" includes="*.jar" />
</classpath>
</taskdef>
My "paths.jaxb.lib" is the path to the jaxb lib folder. How can I get this value from my paths.properties file?
Read the properties file before the <taskdef>
task.
If paths.properties
is...
paths.jaxb.lib=path/to/my/jaxb/lib
...then in build.xml
...
<!-- Loading the Java properties file sets the paths.jaxb.lib Ant property. -->
<property file="paths.properties"/>
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath>
<fileset dir="${paths.jaxb.lib}" includes="*.jar" />
</classpath>
</taskdef>