ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Roodt <gro...@gmail.com>
Subject Re: Adding Optional Jars in an Ant build
Date Wed, 28 Apr 2010 10:15:30 GMT
It is a bit annoying that most of the Optional Tasks have this classloader
complication.

Peter is spot on, its a nightmare of workarounds to get this type of thing
working as seamlessly as the junit task.

Depending on how badly you want this, the mechanism in the attached test
project works for me in 1.7.1. *Disclaimer: this may not work in future
versions. **Credit to Robert Flaherty for introducing me to this
technique/hack.

Greg



On Tue, Apr 27, 2010 at 9:08 PM, Peter Reilly
<peter.kitt.reilly@gmail.com>wrote:

> The scp ant task classes are in the same classloader as
> the rest of the body of ant (except for the launcher classes).
>
> See the code for junit and script for the hideous workarounds
> that are needed to get them to allow <classpath> to load
> their required third party classes.
>
> A similar effort will need to be done for <scp> to enable it
> to work the same way.
>
> The ant-contrib ant task classes are not in the same classloader
> as the body of ant, so there is not the same problem.
>
> Peter
>
>
> On Tue, Apr 27, 2010 at 6:18 PM, David Weintraub <qazwart@gmail.com>
> wrote:
> > Now that I have an Ant installation that has the ant-jsch.jar file in
> > it, I'm able to run the <scp> task. However, in order to do that, I
> > have to run it as "ant -lib antlib" instead of just "ant".
> >
> > With the AntContrib tasks, I can define a directory "antlib" in my
> > project, and then add it in with the <typedef> task. If I simply use
> > the AntContrib stuff, I don't have to use the "ant -lib antlib"
> > parameter. I'd like to do the same thing with the "scp" task.
> >
> > BTW, I know I could also put the needed jars in $ANT_HOME/lib or
> > $HOME/.ant, but I want a way to do this by simply checking out the
> > project and have the project have the needed jarfiles.
> >
> >
> > --
> > David Weintraub
> > qazwart@gmail.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

Mime
View raw message