由于通过tomcat的manager无法完全清除msms目录,导致重新deploy会无效,于是想出了怪招:
    <target name="deploy-local" description="Install application in Local Tomcat">
        <echo message="deploying to local ..." />
        <exec executable="cmd" os="Windows 2000" vmlauncher="false">
            <arg line="/c start ${tomcat.dir}/bin/shutdown.bat" />
        </exec>
        <delete dir="${tomcat.webapps}/${context-path}" />
        <copy todir="${tomcat.webapps}" overwrite="true">
            <fileset dir="${dist}">
                <include name="${context-path}.war" />
            </fileset>
        </copy>
        <exec
executable="${tomcat.dir}/bin/startup.bat" os="Windows 2000"
spawn="true" vmlauncher="false">
            <arg line="/c start ${tomcat.dir}/bin/startup.bat" />
        </exec>
    </target>
首先通过调用shutdown.bat,而且不设置spawn="true",这样就会有一个cmd窗口在那里留着,可以看着tomcat停掉了,然后关
闭这个cmd窗口,ant才会继续向下执行删除和拷贝,然后自动启动tomcat。虽然看上去比较怪,好歹还算管用,哈哈。