Rob Wilson wrote:
Hi All,
I have written my first Ant script from scratch, using google and the
O'reilly definitive guide. I'm mostly happy with what I have ended up with,
however when I try to use the Tomcat DeployTask my application is not
deployed as expected.
If I manually copy my war file to the webapps directory everything is fine,
so I really would like to understand how to use ant to deploy using the
Tomcat task (rather than copying directly to the webapp folder - it seems
cleaner).
Speaking as the author of the alternative book, I'd argue in favour of
deploying by copying the file.
-its not any cleaner
-its significantly less brittle
-it lets you deploy in a secure environment
-it ports to jboss, glassfish, etc, simply by changing the target dir.
-you can undeploy using <delete> even if the application is already
undeployed (whereas the tomcat tasks raise an error)
the tomcat tasks (from the tomcat team) generates HTTP command to talk
to the tomcat manager. Which means that the management API needs to be
made visible.
Just stick to using <copy>
-Steve
ps:
<target name="War" depends="Initialize, Compile">
<echo message="Generating War file..."/>
<war destfile="${warfile}" webxml="${web-inf.dir}/web.xml">
<classes dir="${src}" includes="**/*.xml" />
<classes dir="${deploy}" includes="**/*.class" />
<fileset dir="${webcontent.dir}">
<include name="**/*"/>
</fileset>
<lib dir="${web-lib.dir}" includes="**/*.jar" />
<lib dir="${common-lib}" includes="**/*.jar" />
</war>
There's no point asking for **/*.jar, as webapps only go one level deep.
You need your lib directory to be flat before building the WAR.
-steve
--
Steve Loughran http://www.1060.org/blogxter/publish/5
Author: Ant in Action http://antbook.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]