I prefer alt.3 and try using taskdefs before without success. I did
try it again now also not successfully. Could you please supply me
with a complete working example?
This is how my (non-working) build.xml looks like now:
(both .jar files are placed in the lib directory under the basedir)
<project name="imweb" default="upload" basedir=".">
<taskdef name="ftp" classname="org.apache.tools.ant.taskdefs.optional.net.FTP">
<classpath>
<pathelement location="/lib/ant-commons-net.jar"/>
<pathelement location="/lib/commons-net-1.1.0.jar"/>
</classpath>
</taskdef>
<target name="upload">
<ftp server="..." userid="... password="..." depends="yes" verbose="yes">
<fileset dir="en" />
</ftp>
</target>
</project>
Is it really necessary to place ant-commons-net in the classpath since
it is already under the ant/lib path? btw! I am using ant.1.6.5
Regards,
Asle
On 7/12/05, Ivan Ivanov <rambiusparkisanius@yahoo.com> wrote:
> Asle,
>
> You have several other alternatives to keep your ant
> distribution clean of external libs:
> 1) Put commons-net-1.1.0.jar in $HOME\.ant\lib (my
> favourite way)
> 2) Place it an arbitrary directory say
> /path/to/thirdparty/jars and use -lib option of ant
> launching script.
>
> 3) (Requires more coding and its benefits are
> doubtful). Move ant-commons-net.jar from $ANT_HOME/lib
> to some other folder and in your build script
> <taskdef> ftp task like this:
> <taskdef name="ftp" classname="...">
> <classpath>
> <pathelement
> location="/path/to/ant-commons-net.jar"/>
> <pathelement location="/path/to/commons-net.jar"/>
> </classpath>
> </taskdef>
>
> Regards
> Ivan
>
> --- Asle Pedersen <apederse@gmail.com> wrote:
>
> > Is it possible to "embed" the ant ftp task in a
> > project. I would like
> > to just depend on a standard ant-installation to use
> > the ftp task and
> > have the commons-net-1.1.0.jar in my project instead
> > of under /ant/lib
> > which is suggested by the documentation. I have
> > tried different
> > methods to do this but none have worked so far. Any
> > suggestions?
> >
> > Regards,
> > Asle
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> >
> >
>
>
>
>
> ____________________________________________________
> Sell on Yahoo! Auctions – no fees. Bid on great items.
> http://auctions.yahoo.com/
>
|