You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Glen Mazza <gr...@verizon.net> on 2006/02/06 14:25:06 UTC

wrapping manager "undeploy" Ant task

Hello,

I'm using the manager tasks for Ant to undeploy and deploy my WAR file 
in Tomcat, as shown below.  Sometimes, due to a previous processing 
error, there is nothing to "undeploy" (i.e., no webapp there) but the 
"deploy" task is still relevant and should still occur.  However, in 
these cases, my Ant target fails because the "undeploy" task returns a 
nothing-to-undeploy error.

Question:  How do I wrap the <undeploy/> task, so that if there is 
nothing to undeploy, the deploy task within this target will still 
activate?  Currently I am just commenting out the undeploy task when 
that situation occurs.

Thanks,
Glen


<target name="deploy" depends="war">

     <undeploy url="${tcManagerURL}" username="${tcUsername}" 
password="${tcPassword}" path="${apppath}"/>

     <deploy url="${tcManagerURL}" username="${tcUsername}" 
password="${tcPassword}" path="${apppath}" war="${war.app.name}.war"/>

</target>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: wrapping manager "undeploy" Ant task

Posted by Glen Mazza <gr...@verizon.net>.
Tim Lucia wrote:

> Add: failOnError="false"
> 

Works great--thanks.  This is already in the documentation[1], but I 
missed it.

Glen

[1] 
http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html#Executing%20Manager%20Commands%20With%20Ant


> 
> Hello,
> 
> I'm using the manager tasks for Ant to undeploy and deploy my WAR file 
> in Tomcat, as shown below.  Sometimes, due to a previous processing 
> error, there is nothing to "undeploy" (i.e., no webapp there) but the 
> "deploy" task is still relevant and should still occur.  However, in 
> these cases, my Ant target fails because the "undeploy" task returns a 
> nothing-to-undeploy error.
> 
> Question:  How do I wrap the <undeploy/> task, so that if there is 
> nothing to undeploy, the deploy task within this target will still 
> activate?  Currently I am just commenting out the undeploy task when 
> that situation occurs.
> 
> Thanks,
> Glen
> 
> 
> <target name="deploy" depends="war">
> 
>      <undeploy url="${tcManagerURL}" username="${tcUsername}" 
> password="${tcPassword}" path="${apppath}"/>
> 
>      <deploy url="${tcManagerURL}" username="${tcUsername}" 
> password="${tcPassword}" path="${apppath}" war="${war.app.name}.war"/>
> 
> </target>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: wrapping manager "undeploy" Ant task

Posted by Tim Lucia <ti...@yahoo.com>.
Add: failOnError="false"


-----Original Message-----
From: Glen Mazza [mailto:grm7790@verizon.net] 
Sent: Monday, February 06, 2006 8:25 AM
To: users@tomcat.apache.org
Subject: wrapping manager "undeploy" Ant task


Hello,

I'm using the manager tasks for Ant to undeploy and deploy my WAR file 
in Tomcat, as shown below.  Sometimes, due to a previous processing 
error, there is nothing to "undeploy" (i.e., no webapp there) but the 
"deploy" task is still relevant and should still occur.  However, in 
these cases, my Ant target fails because the "undeploy" task returns a 
nothing-to-undeploy error.

Question:  How do I wrap the <undeploy/> task, so that if there is 
nothing to undeploy, the deploy task within this target will still 
activate?  Currently I am just commenting out the undeploy task when 
that situation occurs.

Thanks,
Glen


<target name="deploy" depends="war">

     <undeploy url="${tcManagerURL}" username="${tcUsername}" 
password="${tcPassword}" path="${apppath}"/>

     <deploy url="${tcManagerURL}" username="${tcUsername}" 
password="${tcPassword}" path="${apppath}" war="${war.app.name}.war"/>

</target>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org