ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Dealing with ClassLoaders
Date Fri, 22 Feb 2002 16:45:53 GMT
On Thu, 21 Feb 2002, Jose Alberto Fernandez <>

>> But even then, we wouldn't solve the current problems.
> Why not? 

There is this task MyEnhancedJunitTask that inherits from JUnitTask.
I put this task into a jar in my system classpath.  In my build file I

<taskdef name="myjunit" classname="MyEnhancedJunitTask" />

No problem in Ant 1.4 as JUnitTask is on the system classpath as
well.  But as soon as MyEnhancedJunitTask gets loaded from the system
classloader (and it will be because of the delegating nature of
AntClassLoader), it will not see JUnitTask in a setup where it has
been loaded by a different classloader.

This example is not really that exotic, people do extend certain Ant
task, see the <javamake> task from the "External Tasks" page, it
extends Javac.

> If there are some tasks that realy would break if not in CLASSPATH
> we could put them in lib.

I'm not sure if and which core tasks would break itself, I'm more
concerned about user written code.


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

View raw message