7 Ekim 2011 Cuma

tomcat deploy ant task

here is tomcat deploy-undeploy targets:


<target name="tomcat-start">
<exec executable="${tomcat.dir}/bin/startup.sh">
<env key="CATALINA_PID" value="${tomcat.pidfile}" />
</exec>
<sleep seconds="2" />
</target>


<target name="tomcat-deploy" depends="war">
<taskdef resource="org/apache/catalina/ant/catalina.tasks" classpathref="tomcat.classpath" />
<deploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" 
war="file:${build.dir}/${name}.war" path="/${name}}" failonerror="true" />
<sleep seconds="2" />
</target>


<target name="tomcat-undeploy">
<taskdef resource="org/apache/catalina/ant/catalina.tasks" classpathref="tomcat.classpath" />
<undeploy url="${tomcat.manager.url}" username="${tomcat.manager.username}" password="${tomcat.manager.password}" 
path="/${name}" failonerror="false" />
</target>


<target name="tomcat-stop" depends="tomcat-undeploy">
<exec executable="${tomcat.dir}/bin/shutdown.sh">
<env key="CATALINA_PID" value="${tomcat.pidfile}" />
</exec>
<delete file="${tomcat.pidfile}" />
</target>


Hiç yorum yok:

Yorum Gönder