ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: taskdef and class loaders
Date Mon, 03 Mar 2003 20:25:46 GMT
How about loading your custom task with an explicit nested <classpath>, the
whole thing inside a target (to delay the task loading). That way, you can
specify whatever classpath you want, for both your task, and its dependent
classes??? This way, your task is loaded using its own instance of an
AntClassLoader, with the dependent classes as well.

Or am I missing something? --DD

-----Original Message-----
From: Mike McNally [mailto:m5@works.com] 
Sent: Monday, March 03, 2003 2:21 PM
To: Ant Users List
Subject: Re: taskdef and class loaders

> You might try using two separate build files, where the one building the
> Java classes calls the other.

Thanks for the response.


I suppose I could try that, though it's a little complicated by the fact
that all my build XML files are generated (starting from a stub build.xml)
by an XSL transform from some simplified declarative XML files for the
source trees.

Also, I'm not having problems with *my* class being loaded; whether or not
my system classpath includes the .class file for my ant task, that class
is successfully loaded.  That's true whether the .class file for the ant
task is built during that invocation of ant or not.  (In other words, I
do a build and it compiles my task, then fails because of the problems 
with the library; an immediately subsequent build fails in exactly the
same way.)

Everything works fine as long as I have no system classpath (or one mostly
disjoint from the build classpath), something I'm currently achieving via
a slightly tweaked launcher shell script.

--
[ you are my main foo ] Mike McNally -- m5@works.com

Mime
View raw message