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"
If I remove the two jar files from the created directory, I get the following:
/Users/david$ ant
Buildfile: build.xml
compile:
[echo] basedir="/Users/david"
[echo] webapp.classpath="${webapp.classpath}"
[echo] webapp.classpath.property=""
If I remove the directory, I get the following output:
/Users/david$ ant
Buildfile: build.xml
BUILD FAILED
/Users/david/build.xml:9: /Users/WEB-INF/lib not found.
Line #9 is where I assign the property to the refid.
Try my build.xml file and see if you get the same results. I'm running
ant 1.7 on a Mac.
On Dec 31, 2007 4:16 PM, david <[EMAIL PROTECTED]> wrote:
> Hello ant dev, commit, gurus and users, I have a strange <path> element in a
> build.xml file. The element is included below. Regardless of what I do to
> remedy the situation the path is constructed with the single directory file
> path token: webapps. For example if the project property basedir="." and the
> basedir is equal to: c:/dev/java/ the path id=webapp.classpath will resolve
> to c:/dev/java/webapps in spite of the fact that webapps does not exist
> anywhere as a property or value. I have run ant -debug but this does not
> display any hidden variables. Please advise, David.
>
> <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>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
--
David Weintraub
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]