Getting Ant scripts to run from eclipse can sometimes be tricky if you are using Ant tasks that require external jar files, for example to run a script to deploy/undeploy to a tomcat server you have to add the make the following configuration changes, the same applies to junit and other external tasks
- In Eclipse go to Window | Preferences | Ant
- Open the Runtime section
- In the Classpath tab: Add to the Global Entries the the catalina-ant.jar file as indicated by the following screen shot.
- In the Tasks tab: Add the Deploy and Undeploy tasks as shown in the following screen shot

