帮助在 OSX 上安装 ANT 的 FTP 任务

发布于 2024-11-02 02:32:23 字数 971 浏览 0 评论 0原文

嘿,全部。我目前正在尝试为 OSX (Snow Leopard 10.6.7) 上安装的 ANT(版本 1.8.2)设置 FTP 支持,但我遇到了困难。我已经阅读了 Apache.org 上涵盖新任务安装的文档以及散布在网络上的几篇文章,但我似乎无法让这个东西工作。

我读过的所有文章都提到了两个特定的 JAR 文件,这些文件未随 ANT 默认安装一起打包:

  1. Commons-Net (2.2.0)
  2. Jakarta ORO (2.0.8)

显然,Jakarta ORO 不再是活跃的 Apache项目,但我找到了存档版本。

然后,显然,我所要做的就是将预编译的 JAR 文件放入相对于 ANT 基本安装目录的 lib 文件夹中。我运行了以下命令:

ant -diagnostics | grep ftp.*Available

我得到以下响应:

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

不高兴。

不知道还能做什么。根据我所读到的内容,我正在执行适当的步骤来让这个东西正常工作。

所以,我已经做了几个小时的尽职调查,我别无选择,只能向大家寻求帮助。下面是 -diagnostics 开关输出的直接链接。希望有人能够阐明我在这里做错了什么。

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

一如既往,我感谢我能得到的任何帮助!

免责声明:过去几个月我一直在使用 OSX,虽然我对使用该终端感觉很舒服,但我仍然相对较新。所以,请……温柔一点。 :)

Hey, all. I'm currently trying to set up FTP support for my ANT (version 1.8.2) install on OSX (Snow Leopard 10.6.7) and I've kind of run into a wall. I've read the documentation on Apache.org covering the installation of new tasks as well as several articles littered throughout the web and I can't seem to get this thing working.

All the articles I've read refer to two specific JAR files that does not come packaged with the default installation of ANT:

  1. Commons-Net (2.2.0)
  2. Jakarta ORO (2.0.8)

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

Then, apparently, all I have to do is drop the precompiled JAR files into the lib folder relative to ANTs base install directory. I ran the following command:

ant -diagnostics | grep ftp.*Available

And I get the following response:

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

No joy.

Not sure what else to do. From what I've read, I'm performing the appropriate steps to get this thing working.

So, I've done a few hours of due diligence and I am left with no choice but to ask you all for help. Below is a direct link to the out put of the -diagnostics switch. Hopefully, someone can shed some light on what I'm doing wrong here.

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

As always, I'm grateful for any help I can get!

DISCLAIMER: I've been using OSX now for the past few months and while I feel pretty comfortable with using the terminal, I'm still relatively new. So, please... be gentle. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

万水千山粽是情ミ 2024-11-09 02:32:23

如果您不想重新安装 Ant 只是为了添加依赖项,您可以执行以下操作:

  • 下载 ant-commons-net.jar 对于您拥有的 Ant 版本(链接适用于 Ant 1.8.2,是 OS X Lion 中包含的 Ant)。
  • 将 jar 放入 ~/.ant/lib/ 中(如果没有,请创建该目录)。
  • 你完成了!

If you don't want to re-install Ant just to add the dependency, you can do this:

  • Download ant-commons-net.jar for the Ant version you have (link is for Ant 1.8.2 which is the Ant included in OS X Lion).
  • Put the jar in ~/.ant/lib/ (create that directory if you don't have it).
  • You're done!
扛起拖把扫天下 2024-11-09 02:32:23

OSX 附带的 ant 版本不包含任何可选任务 - 不仅仅是依赖项(例如 commons-net),实现任务本身的 jar 文件也不存在。我认为,在编译 ant 时,只有当机器上存在依赖项(因为它们引用它们)并且编译 mac ant 版本的苹果工程师(或构建机器)没有依赖项时,才会构建这些任务。

例如:

~ $ 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

但是(我从 Apache 下载了 ant,安装在本地的 ~/tools 目录中):

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

并且:

~ $ 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

你最好的选择可能是获取 直接从 Apache 站点 并将其安装在本地某处。

The version of ant that comes with OSX doesn't include any of the optional tasks - not just the dependencies (e.g. commons-net), the jar files that implement the tasks themselves aren't there. I think that when compiling ant, those tasks are only built if the dependencies are present on the machine (as they reference them) and the apple engineer (or build machine) that compiled the mac ant version didn't have the dependencies.

For example:

~ $ 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 dir):

~ $ 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

Your best bet is probably to get a version of ant direct from the Apache site and install it locally somewhere.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文