posts - 165, comments - 198, trackbacks - 0, articles - 1
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          ant ftp 使用

          Posted on 2008-03-25 11:25 G_G 閱讀(2561) 評論(0)  編輯  收藏 所屬分類: ant
          參考: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
          ??? 有時間 再嘗試
          ??? ?? ?? ?? ??
          ??? ?? ?? ?? ??


          主站蜘蛛池模板: 二手房| 嘉荫县| 连州市| 和田市| 酒泉市| 扶余县| 广东省| 塘沽区| 安徽省| 泗洪县| 华宁县| 温宿县| 紫云| 札达县| 仪陇县| 祁阳县| 遂川县| 武邑县| 阿鲁科尔沁旗| 杭州市| 裕民县| 兴业县| 安溪县| 耿马| 许昌市| 云林县| 凌云县| 南皮县| 成武县| 射洪县| 关岭| 利川市| 且末县| 行唐县| 万年县| 龙岩市| 进贤县| 密山市| 莱州市| 文登市| 商水县|