ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "O'Hara, Patrick" <>
Subject RE: creating a default classpath
Date Thu, 31 May 2001 13:12:39 GMT
	That did it.  Though Ant had no problem with a path in a property.

Pat O

-----Original Message-----
From: Benet Devereux []
Sent: Wednesday, May 30, 2001 3:48 PM
Subject: Re: creating a default classpath


Giving something an ID doesn't make it a property of the project, so you
can't refer to it using the ${} notation; also, you can't, so far as I
know, make a <path> a property -- properties are always strings. Giving
it an ID makes it an object that you can refer to. (This means you can't
print it out easily for debugging, a source of some irritation.) You
also didn't show your <javac> task, but I would surmise that it had
something like

...    classpath="${project.classpath}" ...

when what you really need is:

...   classpathref="project.classpath" ...

And that should do the trick. Oh, and make the <path> a top-level child
of the project; don't put it inside <property> tags, as this is
meaningless and Ant may object.

Hope this helps.

B. Devereux

"O'Hara, Patrick" wrote:

> 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
> 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?

View raw message