Help Setting an FTP task for ANT on OSX

Hey there. I'm currently trying to configure FTP support for my installation of ANT (version 1.8.2) on OSX (Snow Leopard 10.6.7), and I’m kind of bumping into a wall. I read the Apache.org documentation covering setting up new tasks, as well as several articles littered all over the network, and I can't get this to work.

All articles read relate to two specific JAR files that do not ship with the default ANT setting:

  • Commons-Net (2.2.0)
  • Jakarta ORO (2.0.8)

Apparently Jakarta ORO is no longer an active Apache project, but I managed to find an archived version.

Then, apparently, all I need to do is delete the precompiled JAR files in the lib folder compared to the base ANT installation directory. I executed the following command:

ant -diagnostics | grep ftp.*Available 

And I get the following response:

 ftp : Not Available (the implementation class is not present) 

There is no joy.

Not sure what else to do. From what I read, I follow the appropriate steps to get this work to work.

So, I did a few hours of due diligence, and I have no choice but to ask all of you for help. Below is a direct link to exit the diagnostic switch. Hope someone can shed some light on what I'm doing wrong here.

http://www.thedrunkenepic.com/uploads/antDiagnostics.txt

As always, I am grateful for any help I can get!

DISCLAIMER: I have been using OSX for the past few months, and although it is very convenient for me to use the terminal, I am still relatively new. So please ... be careful. :)

+4
source share
2 answers

The ant version supplied with OSX does not include any additional tasks, and not just dependencies (for example, commons-net), jar files that perform the tasks themselves do not exist. I think that when compiling ant, these tasks are created only if the dependencies are present on the machine (because they refer to them), and the software engineer (or collector) who compiled the version of mac ant had no dependencies.

For instance:

 ~ $ ls /usr/share/java/ant-1.8.2/lib/ant-commons-net.jar ls: /usr/share/java/ant-1.8.2/lib/ant-commons-net.jar: No such file or directory 

but (I have ant downloaded from Apache installed locally in my ~/tools directory):

 ~ $ ls tools/apache-ant-1.8.2/lib/ant-commons-net.jar tools/apache-ant-1.8.2/lib/ant-commons-net.jar 

and

 ~ $ jar -tf tools/apache-ant-1.8.2/lib/ant-commons-net.jar | grep FTPTask.class org/apache/tools/ant/taskdefs/optional/net/FTPTask.class 

It is best to get the ant version directly from the Apache website and install it locally somewhere.

+4
source

If you do not want to reinstall Ant only to add dependencies, you can do this:

  • Download ant -commons-net.jar for the version of Ant you have (link for Ant 1.8.2 which is Ant included in OS X Lion).
  • Put the jar in ~/.ant/lib/ (create this directory if you don't have one).
  • Everything is ready!
+5
source

All Articles