ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Woinoski <>
Subject Using Ant to test whether a web app is installed on Tomcat
Date Mon, 22 Mar 2004 19:42:33 GMT
I'm using Ant 1.5 to develop and test web apps with Tomcat 5. I need a way to 
use an Ant task to determine whether a particular web app is installed.

Currently, my init task uses <available> to check the existence of a marker 
file. Then the build task tests the property set by <available>. If the marker 
file doesn't exist, the build task creates the marker file and installs the app. 
If the marker file exists, the build task reloads the app.

However, this simple scheme frequently fails because there are times when the 
marker file exists but the application failed to install. I need a way to make 
the test for a successful installation more reliable.

I thought about doing away with the marker file and instead using a Perl script 
that runs "ant list", searchs for the app context name in Ant's output, and sets 
a return code. But how do I test the return code in build.xml? The exec task 
supports a resultproperty attribute but I don't see a way to test the property's 

Note: I need to use Ant 1.5 bundled with JWSDP, so Ant 1.6 features won't help.



Mike Woinoski                      Pine Needle Consulting

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message