wiki:EclipseDeploy

톰캣 서버에 deploy

ant 빌드 파일에 추가

catalina-ant의 task 설정

<taskdef resource="org/apache/catalina/ant/catalina.tasks">
  <classpath>
   <fileset file="${tomcat.home}/bin/tomcat-juli.jar" />
   <fileset file="${tomcat.home}/lib/jasper.jar" />
   <fileset file="${tomcat.home}/lib/servlet-api.jar" />
   <fileset file="${tomcat.home}/lib/catalina-ant.jar" />
  </classpath>
 </taskdef>

deploy task

톰캣에 deploy 하기전에 톰캣 매니저가 미리 등록되어 있어야 한다.

<target name="deploy" depends="dist" description="deploy to tomcat server">
     <deploy url="${manager.url}"
         username="${manager.username}"
         password="${manager.password}"
         path="/${project.name}"
         war="${war.file}" />
 </target>

undeploy task

톰캣에 deploy된 webapp를 삭제한다.

 <target name="updeploy" description="deploy from tomcat server">
     <undeploy url="${manager.url}"
            username="${manager.username}"
            password="${manager.password}"
            path="/${project.name}" />
</target>

start

톰캣의 webapp을 시작한다.

<target name="start" description="start webapp from tomcat">
     <start url="${manager.url}"
         username="${manager.username}"
         password="${manager.password}"
         path="/${project.name}" />
    </target>

stop

톰캣의 webapp을 종료한다.

<target name="stop" depends="" description="stop webapp from tomcat">
     <stop url="${manager.url}"
        username="${manager.username}"
        password="${manager.password}"
        path="/${project.name}" />
    </target>

reload

톰캣의 webapp을 재시작한다.

<target name="reload" depends="" description="reload webapp from tomcat">
     <reload url="${manager.url}"
         username="${manager.username}"
         password="${manager.password}"
         path="/${project.name}" />
    </target>

list task

톰캣에 deploy 된 webapp 리스트를 출력한다.

 <target name="list" description="list webapp from tomcat server">
     <list url="${manager.url}" username="${manager.username}" password="${manager.password}" />
    </target>

clean-work

톰캣의 work 폴더 내용을 삭제한다. (서비스 중인 내용을 삭제)

<target name="clean-work" depends="" description="delete file from tomcat work folder">
        <delete dir="${tomcat.home}/work/Catalina/localhost/${project.name}"></delete>
</target>