ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject Ant-1.5.1beta1 <ant ... inheritRefs="true" /> not working, nor is nested <reference ... />... bug???
Date Fri, 13 Sep 2002 05:21:21 GMT

I think I've found a bug in the <ant> task.

I've tried both of the following in my main build file to pass the <path> 
references to the sub-build with <ant>

<ant antfile="build-contrib.xml" target="control" inheritRefs="true" />
<ant antfile="build-contrib.xml" target="control" >
         <reference refid="build.classpath" />

But in my build-contrib.xml file, when I reference "build.classpath", which 
I've defined as a <path id="build.classpath"> in my main build, using 
something like <classpath refid="build.classpath" />, I get the following 

Reference build.classpath not found.

One curious thing to note here is that the error happens at the line of my 
<ant ...> call in the main build file whereas the error is actually 
happening on line 38 in my build-contrib.xml where I have <classpath 
refid="build.classpath" />.

What I've done to work around this is create a <path id="build.classpath"> 
inside my subbuild and that works for most things.  However, when I try to 
use the <foreach> task from the ant-contrib project when I initialize the 
it with a <taskdef> such as the following...

<taskdef resource="net/sf/antcontrib/" >
         <classpath refid="build.classpath" />

I end up getting a really weird error like this:

not found.

The only place ${build.lib.dir} is referenced (as far as <foreach> is 
concerned) is in a <fileset> nested inside the original
<path id="build.classpath"> in my main build file which looks like this...

<path id="build.classpath">

         <!-- development libraries -->
         <fileset dir="${build.lib.dir}" >
             <include name="*.jar" />
             <exclude name="${}" />
             <exclude name="${}" />
             <exclude name="${}" />

         <!-- other development libraries -->
         <fileset dir="${build.jar.dir}" >
             <include name="*.jar" />


How this is happening, I have no idea???

The <foreach> badness is fixed if I just put the ant-contrib.jar into 
$ANT_HOME/lib and leave out the nested <classpath> element inside the 
<taskdef> definition for ant-contrib like this...

<taskdef resource="net/sf/antcontrib/" />

Another odd thing is that the <if> task works just fine with the nested 
<classpath> inside the <taskdef>.  It is just the <foreach> that doesn't

Anyone know what is going on here?   There are a few different bugs I've 
described, but they all seem to boil down to one root cause, which is <ant> 
not passing the ref's properly.



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

View raw message