티스토리 뷰

이클립스에서 ant를 이용하여 빌드를 할 때, 빌드된 바이너리 파일을 sftp로 개발서버 등에 한방에 올리는 방법~~~

우선, ant에서 sftp연동을 할 수 있도록 관련 라이브러리를 아래 ant 클래스패스에 추가해 준다.

Windows -> Preferences -> Ant -> Runtime 에서 'Ant Home Entries' 에 첨부된 파일의 압축을 풀어 maverick-ant.jar 를 추가시켜준다.



그리고, build.xml 에 아래 내용을 적절(?)하게 추가하면 된다.~

(각 변수들은 각자의 환경에 맞게 수정~수정~)

<target name="upload" description="ftp upload about SessionServer files(jar and config)">

     <ssh host="${ftp.server}" port="22"

         username="${ftp.id}" password="${ftp.pw}"

         version="2" >

    <!-- 파일 업로드 -->

    <sftp action="put" remotedir="${ftp.dir}" verbose="true">

    <fileset dir="${basedir}">

      <include name="bin/*.jar"/>

      <include name="lib/*.jar"/>      

      <include name="conf/*.*"/>

      </fileset>

      <fileset dir="${common_base.dir}">      

      <include name="lib/*.jar"/>

      </fileset>

    </sftp>

</ssh>

 </target>



maverick-ant.zip



공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함