1 Jan 2008 02:12
Re: <path id=> and classpath mystery
David Weintraub <qazwart <at> gmail.com>
2008-01-01 01:12:26 GMT
2008-01-01 01:12:26 GMT
I created a simple build.xml based upon what you gave:
<project name="myapp" default="compile" basedir=".">
<property name="webapp" value=""/>
<property name="app.home" location=".."/>
<path id="webapp.classpath">
<fileset dir="${app.home}/${webapp}/WEB-INF/lib"
includes="**/*.jar"/>
</path>
<property name="webapp.classpath.property" refid="webapp.classpath"/>
<target name="compile">
<echo message="basedir="${basedir}""/>
<echo message="webapp.classpath="${webapp.classpath}""/>
<echo message="webapp.classpath.property="${webapp.classpath.property}""/>
</target>
</project>
I created two jar files in the classpath, foo.jar and bar.jar. When I
run ant, I get the following output:
/Users/david$ ant
Buildfile: build.xml
compile:
[echo] basedir="/Users/david"
[echo] webapp.classpath="${webapp.classpath}"
[echo] webapp.classpath.property="/Users/WEB-INF/lib/bar.jar:/Users/WEB-INF/lib/foo.jar"
(Continue reading)
RSS Feed