You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Joe Moore <i_...@yahoo.com> on 2006/07/13 16:21:19 UTC

Passing References from Master Build File to Child

I'm having problems passing a path reference from a Master build file to a child build file.
I've read through the user manual, a few books and Googled and am still having problems. 

So I figure I'm missing something simple. Perhaps in the child build file? I think I've called the <ant> task properly to pass the reference of my master.class.path reference to the child build file.

I'm running Ant 1.6.5, Java 1.4.2_10-b03 on a Windows XP box. Eclipse 3.2 (Running it outside of Eclipse gives me the same error.)

The failure message I receive from Ant is:

Buildfile: build.xml

goAnt:

BUILD FAILED
C:\Documents and Settings\524781\workspace\AntExamples\build.xml:14: The following error occurred while executing this line:
C:\Documents and Settings\524781\workspace\AntExamples\AntForm\build.xml:17: Reference master.class.path not found.

Total time: 0 seconds

I'm running Ant in the Master build file's directory. The child build file is in a subdirectory.

Below are the two simplified Ant build files

-- Master File -- 

<project name="master" basedir="." default="goAnt">
    <description>
        An Example of a Master ANT build file.
    </description>   
    <property name="antform.dir" location="AntForm"/>
    <property name="lib.dir" location="lib"/>   
    <path id="master.class.path">
        <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
        </fileset>
    </path>   
    <target name="goAnt"
        description="Example Master Ant File">
        <ant dir="${antform.dir}" inheritall="false">
            <reference refid="master.class.path"/>
        </ant>      
    </target>
</project>

-- Child File  (in AntForm subdirectory) --

<project name="AntForm" default="run" basedir="."
    xmlns:sardak="net.sf.antforms">
    <description>
        Example of using the AntForm ANT extension.
    </description>
    <property name="lib.dir" location="lib"/>    
    <path id="lib.path">
        <fileset dir="${lib.dir}">
            <include name="**/*.jar"/>
        </fileset>
        <path refid="master.class.path"/>
    </path>    
    <taskdef resource="com/sardak/antform/taskdefs.properties"
        classpathref="lib.path"
        uri="net.sf.antforms"
        description="Provides a GUI to gather user input for ANT tasks."
    />    
    <target name="run"
        description="Example run of an AntForm">
        <sardak:antmenu title="AntMenu Example">
            <link label="Quit" target="end"/>
        </sardak:antmenu>        
    </target>
    <target name="end">
        <echo message="Goodbye!"/>
    </target>
</project>

Thanks,
 
Joe Moorei_bugsy@yahoo.com




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