ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: Putting Classpath Into My Own Ant Task
Date Wed, 09 Jun 2004 17:10:47 GMT
> From: Dave Westerman []
> I am writing my own Ant task as a wrapper to a utility which I have
> written. I have 3rd-party jar files which my utility needs in order to
> run. The Ant manual suggests that you always allow a user of your task to
> specify the classpath. I'm assuming I should use the builtin embedded
> <classpath> element. But I can find no examples of doing this.
> I'm assuming I need a createClasspath() method, and a setClasspath(Path)
> method in my Ant task. But how do I then use the new classpath? Do I have
> to use the Ant Java task to call my utility class, instead of calling it
> directly from my Ant task, so that I can pass in the new classpath?
> Any help would be greatly appreciated!

No, no, no. If your task depend on 3rd party classes, then it will never be
loaded unless these classes are available, so your task having a <classpath>
nested element does no good.

The 3rd party classes you require either must be in the system CLASSPATH, or
in ant/lib (as JARs), or specified explicitly at <taskdef> time in a nested
<classpath>. --DD

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message