ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peterson, Lance" <lpeter...@verticore.com>
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-->
  </path>
  
  <target name="compile">
    <javac>
      <!--Refer to a path reference by its id-->
      <classpath refid="projclasspath" />
 
      <!--add additional javac arguments, including 
          more classpath elements if necessary
      -->
    </javac>
  </target>
</project>
 
Look for the section on "References" in the Ant User Guide (
http://jakarta.apache.org/ant/manual/using.html#references
<http://jakarta.apache.org/ant/manual/using.html#references> ).
 
Hope this helps,
Lance Peterson
Verticore Technologies Inc.
 
 -----Original Message-----
From: O'Hara, Patrick [mailto:patrick.ohara@workscape.com]
Sent: Wednesday, May 30, 2001 1:20 PM
To: 'ant-user@jakarta.apache.org'
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
file.

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"/> 
          </fileset> 
      </classpath> 
    </property> 
<echo message="Class Path is ${project.classpath}"/> 

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

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

initdev: 

compile: 
    [javac] Compiling 2711 source files to
C:\weblogic\CoventryDevelopment\classes 

BUILD FAILED 

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-3849 
262-408-3840 Fax 
patrick.ohara@workscape.com 




Mime
View raw message