ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <qazw...@gmail.com>
Subject Re: <path id=> and classpath mystery
Date Tue, 01 Jan 2008 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=&quot;${basedir}&quot;"/>
       <echo message="webapp.classpath=&quot;${webapp.classpath}&quot;"/>
       <echo message="webapp.classpath.property=&quot;${webapp.classpath.property}&quot;"/>
   </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 <david@davidwbrown.name> 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: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 
--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message