2009年12月11日 星期五

設定 Tomcat Hot Deploy

編輯 %CATALINA_HOME%\conf\context.xml
加入下面兩項 attributes,不然無法 hot deploy
<Context>
<Context antijarlocking="true" antiresourcelocking="true"></context>
直接用 Ant 部署,只要更新 webapps 下面的 *.war 之前,先刪除 war 即可。

<property name="warfile" value="foo"/>    
<property name="deploydir"  value="c:\tomcat\webapps"/>

<delete file="${deploydir}\${warfile}.war"/>
<delete file="${deploydir}\${warfile}.war"/>
        <copy todir="${deploydir}" overwrite="true">
        <fileset dir=".">
            <include name="*.war"/>
        </fileset>
</copy>

測試環境是 Tomcat 5.5, win32

沒有留言:

張貼留言