读书人

ant起步和关闭tomcat

发布时间: 2012-09-14 23:00:49 作者: rapoo

ant启动和关闭tomcat
1.ant 直接启动tomcat,build.xml配置1.1启动tomcat

注意tomcat.home是你的tomcat的安装路径

<target name="start-tomcat" description="tomcat starting.....">        <exec executable="${tomcat.home}/bin/startup.bat" spawn="true" vmlauncher="false">        <env key="CATALINA_HOME" value="${tomcat.home}" />        <arg line="/c start ${tomcat.home}/bin/startup.bat" />      </exec>   </target>
??1.2关闭tomcat
<target name="tomcat.stop"><java jar="${tomcat.home}/bin/bootstrap.jar" fork="true"><jvmarg value="-Dcatalina.home=${tomcat.home}"/><arg line="stop"/></java><waitfor maxwait="5" maxwaitunit="second">        <available file="errors.log"/></waitfor></target>
?

读书人网 >移动开发

热点推荐