I have a build.xml which will undeploy my existing web context and re-deploy it again. The build.xml is as below. But my requirement is I will send the condition from command line.
<!--
Tomcat Ant Tasks -->
<!--<project name="webmodulebuilder" default="remove" basedir=".">-->
<project name="webmodulebuilder" default="all" basedir=".">
<taskdef file="D:/AntExample/TomcatAnt/tomcatTasks.properties">
<classpath>
<pathelement path="C:\Program Files\Apache Software Foundation\Tomcat 5.0\server\lib\catalina-ant.jar"/>
</classpath>
</taskdef>
<target name="install" description="Install application in Tomcat" >
<deploy url="http://localhost:8080/manager/html"
username="admin"
password="admin"
path="/AdderWAR"
war="file:E://AntExample//AdderDeploy//dist//AdderWAR.war"/>
</target>
<target name="check-cond">
<condition property="cond-is-true">
<and>
<equals arg1="Yes" arg2="${x}" />
</and>
</condition>
</target>
<target name="uninstall" description="Remove application from Tomcat" depends="check-cond" if="cond-is-true">
<undeploy url="http://localhost:8080/manager/html"
username="admin"
password="admin"
path="/AdderWAR"/>
</target>
<target name="all" depends="uninstall, install" />
</project>
After execution of uninstall target it is saying BUILD FAILED. And not installing the new web module again. Can somebody look into the script and tell me if I am doing any mistake.
It is generating HTML dump like below . There is more HTML dump so I am pasting some part.
D:\AntExample\TomcatAnt>ant -Dx=Yes
Buildfile: build.xml
check-cond:
uninstall:
[undeploy] <html>
[undeploy] <head>
[undeploy] <style>
[undeploy] H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,A
rial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;backgrou
nd-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Ta
homa,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;f
ont-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;} table {
[undeploy] width: 100%;
[undeploy] }
[undeploy] td.page-title {
[undeploy] text-align: center;
[undeploy] vertical-align: top;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] font-weight: bold;
[undeploy] background: white;
[undeploy] color: black;
[undeploy] }
[undeploy] td.title {
[undeploy] text-align: left;
[undeploy] vertical-align: top;
.
.
.
.
[undeploy] <hr size="1" noshade="noshade">
[undeploy] <center><font size="-1" color="#525D76">
[undeploy] <em>Copyright © 1999-2003, Apache Software Foundation</em></font></center>
[undeploy] </body>
[undeploy] </html>
BUILD FAILED
Thanks in advance
Srinivas Ivaturi.