Hi Steve, Thank you for the tips, for some strange reason the file never gets created?! I have included verbose in the copy task, with the output I copied+paste the source file and destination dir into explorer to confirm the source file and destination directory exists...
I assume it's because of the c:/program files bit? - I also have drive E on my machine, if I remove c: it copies to e:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps ok. So whats the format to force it to go to c:.... ? Cheers, Rob. <property name="local.tomcat.webapp.path" value="c:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps"/> <property name="deploy" location="./deploy"/> <property name="warfile" location="${deploy}/ciderbob-website.war"/> <echo message="deploy-local - copying ${warfile} to ${ local.tomcat.webapp.path}..."/> <copy todir="${local.tomcat.webapp.path}" file="${warfile}" failonerror="yes" overwrite="yes" verbose="yes"/> On 10/31/07, Steve Loughran <[EMAIL PROTECTED]> wrote: > > 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] > > -- Regards, Rob Wilson