ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: <script> needs a classpath param
Date Mon, 06 Aug 2001 08:01:12 GMT
On Sat, 4 Aug 2001, Paul Hammant <> wrote:

> I have taken a look.  Basic classpath ala SQLExec or XSLTProcessor
> is quite easy, but I think that it won't work for BSF hosted scripts
> as execution is leaving ant and going into BSF.  As that is in Ant's
> basic lassloader, it will not be able to find anything in a sub
> classloader.

Sounds like a similar problem we have in <junit>, either you put all
stuff required to run the tests (i.e. junit.jar and the task) into the
system classloader, or nothing at all) - the difference here is that
Ant is responsible for loading the test classes, so it can take
advantage of a classloader of its own.

In the <script> case, you'll have to make sure that you load the task
itself, BSF and the language specific parser via the same classloader
and also load all utility classes your scripts need via this one,

Do you know whether BSF supports context classloaders?

> We need some forking thing like javac & java

Would probably work, yes.

> .. OR .. bsf.jar is not added to the general classpath by lcp.bat
> and is implicitly added in "Path createClasspath() {}".

I'd rather put some extensive comments in the documentation that
explain how to set up an envirionment like this, than to modify the
wrapper scripts to deal with bsf.jar in a separate way.


View raw message