Dear Sir/Madam, The 'accepted' approach to building and installing WARs using the Catalina Ant tasks, after first starting Tomcat, is... <taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/> <install url="${tomcat.manager}" username="${tomcat.username}" password="${tomcat.password}" path="/${tomcat.app}" war="file://${builddir}/myapp.war"/> ...however this will FAIL on subsequent builds (without restarting Tomcat) with an 'application already installed' BuildException, so the subsequent 'accepted' approach is... <taskdef name="install" classname="org.apache.catalina.ant.RemoveTask"/> <taskdef name="install" classname="org.apache.catalina.ant.InstallTask"/> <remove url="${tomcat.manager}" username="${tomcat.username}" password="${tomcat.password}" path="/${tomcat.app}"/> <install url="${tomcat.manager}" username="${tomcat.username}" password="${tomcat.password}" path="/${tomcat.app}" war="file://${builddir}/myapp.war"/> It should be noted that, equally, this latter approach will FAIL the first time in (with a 'no application to remove' BuildException). Having to toggle between these two approaches every 'development session' (the former the first time in, the latter all subsequent times before restarting Tomcat) is very unproductive. None of the 'accepted' docs seem to address this problem, so either I am being an idiot (very possible :) or we could really do with a, say, 'ignoreFailure' parameter in AbstractCatalinaTask (that simply catches the Exception, logs it, but does not stop the build for it). That way we could use the latter build script every time, making things much easier for us all :) Many thanks for your time,
(sorry - I messed up my 'taskdefs' in the second Ant script, but it doesn't change the problem)
No response from anybody? Just to encourage you, I've implemented this (very simple) change in my own build scripts and it really is very beneficial...
Than why don't you attach a patch to this bugreport?
Created attachment 5190 [details] Added a 'ignoreFailure' flag to prevent Ant tasks stopping the build
Wow - excuse my ignorance in not knowing I was meant/able to do this (I hope your comment wasn't meant harshly?). I have, as instructed, attached a new version of AbstractCatalinaTask that I have found to be useful in my own builds. There will, of course, still need some docs to be updated (if, indeed, you approve my change).
No, my comment wasn't meant harshly. Just a question. Little short maybe. But I don't have commit rights, so I can't do anything with it, but there are other ant developers out there who do these things and the chance is much bigger they do something with a bug report with a patch attached, than one without. :-)
*** This bug has been marked as a duplicate of bug 10225 ***