ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Access to custom task's classpath?
Date Tue, 14 Oct 2008 04:10:25 GMT
On Mon, 13 Oct 2008, Jeremy Mawson <> wrote:

> I have a custom task defined thus:
> <taskdef resource="" classpathref="task.class.path"/>
> The classpathref contains the jar which includes both my Task and a
> file resource. When I try to obtain the resource in the Task at
> runtime I'm unable to find it.

You should be able to load it with MyTask.class.getResource().

> When I print out the java.class.path property in the task, it does
> not include the jar my Task is in!

This property only reflect what the system classloader sees.  Your
task has been loaded by a different classloader that has your custom
jars in it as well.  You can get this ClassLoader via


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

View raw message