You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

You can deploy a war file using the following ant tasks -
Read this first http://tomcat.apache.org/tomcat-5.0-doc/manager-howto.html

  1. You need to have the tomcat manager application available for the host - add a context manager.xml file

pointing to ${catalina.home}/server/webapps/manager, which should be installed by default

2. Add the catalina-ant.jar to your classpath... mine was in ${catalina.home}/server/lib

<taskdef resource="org/apache/catalina/ant/catalina.tasks" classpathref="your.class.path" />

<target name="tomcat.undeploy" >
  <undeploy url="${deploy.url}" failOnError="false" username="${deploy.user}" password="${deploy.pass}" path="${deploy.context}"/>
</target>

<target name="tomcat.deploy" >
  <deploy url="${deploy.url}" username="${deploy.user}" password="${deploy.pass}" path="${deploy.context}" war="file:${deploy.war}"/>    	    	
</target>
	
<target name="tomcat.start" >
  <start url="${deploy.url}" failOnError="false" username="${deploy.user}" password="${deploy.pass}" path="${deploy.context}"/>
</target>
	
<target name="tomcat.stop" > 
  <stop url="${deploy.url}" failOnError="false" username="${deploy.user}" password="${deploy.pass}" path="${deploy.context}"/>
</target>

See also http://raibledesigns.com/wiki/Wiki.jsp?page=TomcatAntTasks

  • No labels