On Fri, 26 Aug 2005, Scokart Gilles wrote:

You would indeed need a classloader with tools.jar in it. However, the
location is jdk specific (there's no artifact in ibiblio for it),
so maven can't provide it.

You could add it to the classpath yourself:

UrlClassLoader cl = new UrlClassLoader(
     Thread.currentThread().getContextClassLoader() );

cl.addUrl( new File( System.getProperty( "java.home" ), "../lib/tools.jar"
) ).toURL() );

(or something very similar) and use that new classloader.

Not sure this is the way to go, though..

-- Kenney

> I have a project that build an ant task, and I would like to use maven to
> build this project :-)
>
> During my tests, I would like to invoke an ANT script that use my task, in
> order to validate that it works as expected.
>
> How can I make this.
>
> I have first tried to write a JUnit test that call this script, but when I
> do that, the ant script is not executed in the correct environment (it
> doesn't have tools.jar in the classpath).  It's probably possible to work
> around, but it will not be easy.
>
> I guess a simpler solution would be to have a maven plugin that setup the
> correct classloader, and call the ant script.
>
> Does such a plugin already exist ?
> Or do you see other alternatives ?
>
>
> SCOKART Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to