ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <>
Subject Re: auto-building a classpath
Date Sat, 10 Mar 2001 21:36:18 GMT
----- Original Message -----
From: "Will Hartung" <>
To: <>
Sent: Saturday, March 10, 2001 10:07 PM
Subject: auto-building a classpath

> Hi all,
> I'm curious if there is a way to automatically create a classpath.
> Specifically, we have a directory that we like to put all of our 3rd party
> jars into for the build, and I was wondering if there is some way that ANT
> can "look" at the directory, and just add all of the jars to the

Yes, simply add

        <fileset dir="myLibDir">
          <include name="**/*.jar" />

to your javac-task. You will get something like this:

    <javac  srcdir="src"
            debug="off" optimize="on">
        <fileset dir="${build.lib}">
          <include name="**/*.jar" />

As an alternative you can define the classpath as path on the project level,
add an 'id="myClasspath"' to the path and use it as "<classpath
refid="myClasspath"/> in every javac-task.


View raw message