ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: Adding Optional Jars in an Ant build
Date Thu, 29 Apr 2010 20:07:26 GMT
Thanks. I tried this and it works. You're basically renaming scp to
my-scp and then adding in both the jsch.jar and the ant-jsch.jar for
your my-scp command.

It's ugly, but it works and hides the issues with having to put the
jars in ant/lib or having to specify environment variable options or
command line parameters.

That's what Ant 1.8.1 needs: A way of allowing projects to include
extra jars without having to put them in specific places or use
special command line options.

On Wed, Apr 28, 2010 at 6:15 AM, Greg Roodt <groodt@gmail.com> wrote:
> 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
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>



-- 
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message