您的位置:首页 > 编程语言 > Java开发

使用Eclipse中的ant功能将生成的JAR文件ftp到服务器

2014-05-18 16:44 495 查看
首先,我的Eclipse版本是Juno,已经带有ant插件。

然后,需要下载commons-net-1.4.1.jar包,这个包我以前下载过已经是commons-net-3.1.jar了。放在workspace/lib目录下。

注意,我并未下载jakarta-oro-2.0.8.jar这个包,也不知道这个包是做什么用的,可能ANT中已经包含了。

然后,在eclipse中操作步骤如下:Window -> Preferences -> Ant -> Runtime

在Classpath栏中选中Ant Home Entries然后Add External Jars...

选择commons-net-3.1.jar包。

然后,修改build.xml加入以下这段:

 <target name="ftp" depends="dist" description="FTP JAR file to wx.citicbank.com">

  <ftp password="xxxx" 

    server="wx.citicbank.com" 

    userid="xxxx" 

    remotedir="/project/xxx">

   <fileset dir="${project.libs}" includes="${filename}.jar">

   </fileset>

  </ftp>

最后,右健build.xml->Run As->Ant Build ,选中“FTP”,RUN即可看到ftp的结果。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ant eclipse jar