How about this maven-antrun-plugin of yours, Kenney ? I tried it on a
hello-world-example, and it's working good. Though, I encounter problems when I
use a <regexpmapper> tag in my build.xml. I figured that ant-apache-regexp.jar
or something is needed, so I added this dependency to maven-antrun-plugin POM :

      <groupId>ant</groupId>
      <artifactId>ant-apache-regexp</artifactId>
      <version>1.6.3</version>
      <scope>runtime</scope>

... which solved nothing. Searching into the archive, I saw that adding a
<properties><classloader>root</classloader></properties> to the dependency
would solve the problem (which links to what you were dealing with below) but
it's not possible any more in Maven 2. Is there another way ?

Yann


Kenney Westerhof wrote:

> 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]


        

        
                
___________________________________________________________________________ 
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger 
Téléchargez cette version sur http://fr.messenger.yahoo.com

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

Reply via email to