We use ant build scripts (launched from eclipse, anthill, command prompts, just about anywhere) to deploy webapps to Tomcat and it works fine for us. But we did have difficulties when we started doing so. We are currently using Tomcat 5.0.28; we've done it for a long time on Tomcat 4.1; we've tested it on Tomcat 5.5, but I can't say that it worked - we had other issues (unrelated to ant or Tomcat) that got in the way.

Its been a while since I went through these problems, but here's my recollections:

a) There are several tasks in the catalina-ant.jar. In particular, though, there are two different sets of tasks that can be used for deploying webapps: <install>/<remove> and <deploy>/<undeploy>. You cannot <remove> a <deploy>'d app nor can you <undeploy> an <install>'d app.

I don't fully recall the difference between those sets of tasks, but we discovered that the <deploy>/<undeploy> tasks worked better for us.

b) We change the unpackWars attribute in the <Host> element of the server.xml from true (its default value on a Windows installation) to false.

Without this change, Tomcat unpacked the deployed webapp, which caused difficultied with the removal (files weren't removed) which then prevented redeployment.

c) Side note about your ant scripts:  your "deploy" target uses a bunch
of ant calls to do different things (build, war, tomcat_deploy and
email).  In each case you are passing inheritrefs=true and
inheritall=true and calling targets in the same build file.  You'd
probably be better off just doing this as dependencies instead:

  <target name="deploy" depends="init, build, war, deploy_tomcat, email"/>

I hope that helps,

--
PC

Paul Christmann
Prior Artisans, LLC
mailto:[EMAIL PROTECTED]
504-587-9072


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to