You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Erickson <de...@cmcflex.com> on 2004/07/03 19:43:44 UTC

Path References Nightmares

Hi everyone.. for the life of me I can't figure out why my global path
reference isn't working.. using ant 1.5.4.. when i run ant test this is what
I get:

Buildfile: build.xml

BUILD FAILED
Reference project.class.path not found.

Total time: 0 seconds

Here's my file:

<project name="myProject" default="test" basedir=".">
 <property environment="env"/>
 <property file="build.properties"/>
 <property name="build.compiler" value="modern"/>
 <property name="src.dir" value="src"/>
 <property name="src.java.dir" value="${src.dir}/java"/>
 <property name="src.test.dir" value="${src.dir}/test"/>

 <property name="target.dir" value="target"/>
 <property name="target.classes.java.dir"
value="${target.dir}/classes/java"/>
 <property name="target.classes.test.dir"
value="${target.dir}/classes/test"/>
 <property name="target.report.dir" value="${target.dir}/reports"/>

 <taskdef name="schemaupdate"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaUpdateTask"
classpathref="project.class.path"/>

 <path id="project.class.path">
  <pathelement location="${env.CATALINA_HOME}/common/lib"/>
  <fileset dir="web/WEB-INF/lib">
   <include name="**/*.jar"/>
  </fileset>
  <dirset dir="web/WEB-INF/classes">
   <include name="**/*"/>
  </dirset>
  <dirset dir="${target.classes.java.dir}">
   <include name="**/*"/>
  </dirset>
  <dirset dir="${target.classes.test.dir}">
   <include name="**/*"/>
  </dirset>
  <fileset dir="${env.JAVA_HOME}">
   <include name="**/*.jar"/>
  </fileset>
 </path>
 <target name="SchemaUpdate">
  <schemaupdate
  properties="${basedir}/hibernate.properties"
  quiet="no">
   <fileset dir="${basedir}/web/WEB-INF/classes">
    <include name="**/*.hbm.xml"/>
   </fileset>
  </schemaupdate>
 </target>

 <target name="compile.java">
  <mkdir dir="${target.classes.java.dir}"/>
  <javac destdir="${target.classes.java.dir}">
   <src path="${src.java.dir}"/>
   <classpath refid="${project.class.path}"/>
  </javac>
 </target>

 <target name="compile.test" depends="compile.java">
  <mkdir dir="${target.classes.test.dir}"/>
  <javac destdir="${target.classes.test.dir}">
   <src path="${src.test.dir}"/>
   <classpath refid="${project.class.path}"/>
  </javac>
 </target>

 <target name="test" depends="compile.java">
  <mkdir dir="${target.report.dir}"/>
  <property name="tests" value="*Test"/>
  <junit printsummary="yes" haltonerror="yes" haltonfailure="yes"
fork="yes">
   <formatter type="xml"/>
   <batchtest fork="yes" todir="${reports.tests}">
    <fileset dir="${src.test.dir}">
     <include name="**/${tests}.java"/>
    </fileset>
   </batchtest>
   <classpath refid="${project.class.path}"/>
  </junit>
 </target>

 <target name="clean">
  <delete dir="${target.dir}"/>
 </target>
</project>

Everything looked good to me but it won't work and is driving me nuts.
Thanks in advance!!
-David


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


Re: Path References Nightmares

Posted by David Erickson <de...@cmcflex.com>.
And after an hour of messing with it and typing this message I figure it out
5 minutes later... lovely =)

I just needed to move my taskdef down after the global path reference since
it was referring to it.
-David

----- Original Message ----- 
From: "David Erickson" <de...@cmcflex.com>
To: "Ant User Mailing List" <us...@ant.apache.org>
Sent: Saturday, July 03, 2004 11:43 AM
Subject: Path References Nightmares


> Hi everyone.. for the life of me I can't figure out why my global path
> reference isn't working.. using ant 1.5.4.. when i run ant test this is
what
> I get:
>
> Buildfile: build.xml
>
> BUILD FAILED
> Reference project.class.path not found.
>
> Total time: 0 seconds
>
> Here's my file:
>
> <project name="myProject" default="test" basedir=".">
>  <property environment="env"/>
>  <property file="build.properties"/>
>  <property name="build.compiler" value="modern"/>
>  <property name="src.dir" value="src"/>
>  <property name="src.java.dir" value="${src.dir}/java"/>
>  <property name="src.test.dir" value="${src.dir}/test"/>
>
>  <property name="target.dir" value="target"/>
>  <property name="target.classes.java.dir"
> value="${target.dir}/classes/java"/>
>  <property name="target.classes.test.dir"
> value="${target.dir}/classes/test"/>
>  <property name="target.report.dir" value="${target.dir}/reports"/>
>
>  <taskdef name="schemaupdate"
> classname="net.sf.hibernate.tool.hbm2ddl.SchemaUpdateTask"
> classpathref="project.class.path"/>
>
>  <path id="project.class.path">
>   <pathelement location="${env.CATALINA_HOME}/common/lib"/>
>   <fileset dir="web/WEB-INF/lib">
>    <include name="**/*.jar"/>
>   </fileset>
>   <dirset dir="web/WEB-INF/classes">
>    <include name="**/*"/>
>   </dirset>
>   <dirset dir="${target.classes.java.dir}">
>    <include name="**/*"/>
>   </dirset>
>   <dirset dir="${target.classes.test.dir}">
>    <include name="**/*"/>
>   </dirset>
>   <fileset dir="${env.JAVA_HOME}">
>    <include name="**/*.jar"/>
>   </fileset>
>  </path>
>  <target name="SchemaUpdate">
>   <schemaupdate
>   properties="${basedir}/hibernate.properties"
>   quiet="no">
>    <fileset dir="${basedir}/web/WEB-INF/classes">
>     <include name="**/*.hbm.xml"/>
>    </fileset>
>   </schemaupdate>
>  </target>
>
>  <target name="compile.java">
>   <mkdir dir="${target.classes.java.dir}"/>
>   <javac destdir="${target.classes.java.dir}">
>    <src path="${src.java.dir}"/>
>    <classpath refid="${project.class.path}"/>
>   </javac>
>  </target>
>
>  <target name="compile.test" depends="compile.java">
>   <mkdir dir="${target.classes.test.dir}"/>
>   <javac destdir="${target.classes.test.dir}">
>    <src path="${src.test.dir}"/>
>    <classpath refid="${project.class.path}"/>
>   </javac>
>  </target>
>
>  <target name="test" depends="compile.java">
>   <mkdir dir="${target.report.dir}"/>
>   <property name="tests" value="*Test"/>
>   <junit printsummary="yes" haltonerror="yes" haltonfailure="yes"
> fork="yes">
>    <formatter type="xml"/>
>    <batchtest fork="yes" todir="${reports.tests}">
>     <fileset dir="${src.test.dir}">
>      <include name="**/${tests}.java"/>
>     </fileset>
>    </batchtest>
>    <classpath refid="${project.class.path}"/>
>   </junit>
>  </target>
>
>  <target name="clean">
>   <delete dir="${target.dir}"/>
>  </target>
> </project>
>
> Everything looked good to me but it won't work and is driving me nuts.
> Thanks in advance!!
> -David
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


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