ant ftp 使用

参考: http://lijunjie.javaeye.com/blog/160977
目的:方便部署文件,不再使用ssh的拷贝和粘贴。
使用:
ant 使用jar 包  jakarta-oro-2.0.1.jar;
                         http://archive.apache.org/dist/jakarta/oro/
                commons-net-1.4.1.jarhttp:
                         http://apache.mirror.phpchina.com/commons/net/binaries/

加载到 eclipes ant 路径上;Window→ Preferences→ Ant→ Runtime+jar

build -> copy action
<? xml version="1.0" ?>
< project >
     < target  name ="init" >
           < ftp  server ="xxx.xxx.xxx.xxx"     
                   userid
="name"
                   password
="pass"
                  remotedir
="/usr/"
                  action
="get"
              
>
                 < fileset  dir ="D:\\ant\\ftp_data" >
                   </ fileset >
           </ ftp >
     </ target >
</ project > 

本例小结:
    时间有限,这里就展现写这些。
    代码的部署方便了。
    听说 sftp 服务器可以用
       需要lib  http://www.jcraft.com/jsch/index.html
        <scp  trust="true" file="./src/Main.java" todir="root:pass@***.***.***.***:/tmp"  />
         
        <sshexec .....>远程运行命令!!!

        还可以参考 命令 rsync http://www.oreilly.com.cn/samplechap/linuxserverhacks/ch38.pdf
    有时间 再尝试
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值