On Sat, Feb 19, 2011 at 9:17 AM, Allan Lewis <allan.e.le...@gmail.com>wrote:

> I'm working on a custom ant task, and want to create a class based on
> classname provided to the task.  I've made a path available to the task,
> but
> can't quite figure out how to make those classes available to the task, so
> I
> wind up getting a java.lang.ClassNotFoundException when trying to create
> the
> class.
>
>
>
> In other words, given the following:
>
>
>
> <path id="my.path">
>
> <fileset dir="lib" includes="*.jar"/>
>
> </path>
>
>
>
> <path id="my.runtime.path">
>
> <fileset dir="lib-runtime" includes="*.jar"/>
>
> </path>
>
>
>
> <typedef name="mytask" classname="com.mytask.MyTask"
> classpathref="my.path"/>
>
>
>
> < mytask classpathref="my.runtime.path" classname="com.foo.Bar"/>
>
>
>
> What has to happen in order to get 'com.foo.Bar' available to my task at
> runtime?
>
> You might find org.apache.tools.ant.AntClassLoader useful for your
purposes.

HTH,
Matt

Reply via email to