I found the answer. Apparently, when you pass a reference to a child Ant build file, you have to access it within a target. It won't work outside of a target. My assumption was everything outside of a target was processed first (aka globals) and then the targets.
Is this the way it was designed? Joe [EMAIL PROTECTED] ----- Original Message ---- From: Joe Moore <[EMAIL PROTECTED]> To: user@ant.apache.org Sent: Thursday, July 13, 2006 10:21:19 AM Subject: 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 [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]