ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peterson, Lance" <>
Subject RE: creating a default classpath
Date Wed, 30 May 2001 21:23:06 GMT
Patrick, try...
<project name="whatever">
  <!--Note: path references are not defined as properties-->
  <path id="projclasspath">
    <pathelement location="${build.classes}" />
    <pathelement location=${weblogic.home}/weblogic451sp13boot.jar" />
    <!--more pathelements-->
  <target name="compile">
      <!--Refer to a path reference by its id-->
      <classpath refid="projclasspath" />
      <!--add additional javac arguments, including 
          more classpath elements if necessary
Look for the section on "References" in the Ant User Guide (
<> ).
Hope this helps,
Lance Peterson
Verticore Technologies Inc.
 -----Original Message-----
From: O'Hara, Patrick []
Sent: Wednesday, May 30, 2001 1:20 PM
To: ''
Subject: creating a default classpath

I have a ANT build script that uses the same classpath over and over.  I can
across the bit in the documentation (Using Ant - Path-like Structures) where
I am told that I can create a path-like structure and give it an id.  I
should then be able to refer to this id from subsequent parts of the build

What I created looks like: 
    <property name="projclasspath"> 
      <classpath id="project.classpath"> 
          <pathelement location="${build.classes}"/> 
          <pathelement location="${weblogic.home}/weblogic451sp13boot.jar"/>

          <pathelement location="${weblogic.home}/classes/boot"/> 
          <pathelement location="${weblogic.home}/weblogic451sp13.jar"/> 
          <pathelement location="${weblogic.home}/lib/weblogicaux.jar"/> 
          <pathelement location="${weblogic.home}/classes"/> 
          <pathelement location="${weblogic.home}/mssqlserver4v70/classes"/>

          <pathelement location="${project_env.JAVA_HOME}"/> 
          <pathelement location="${project_env.JAVA_HOME}/lib"/> 
          <fileset dir="${jar.dir}"> 
            <include name="**/*.jar"/> 
            <include name="**/*.zip"/> 
<echo message="Class Path is ${project.classpath}"/> 

I get the error: 
Buildfile: C:\weblogic\CoventryDevelopment\build.xml 

     [echo] Class Path is ${project.classpath} 


    [javac] Compiling 2711 source files to


C:\weblogic\CoventryDevelopment\build.xml:115: Reference
${project.classpath} not found. 

Total time: 3 seconds 

Obviously I am approching this incorrectly.  Has anyone else done this? 

Patrick O'Hara 
Workscape, Inc 
N17 W24222 Riverwood Pl 
Waukesha, WI 53188-1162 
262-408-3840 Fax 

View raw message