Deployment in Tomcat using ANT Script

Hi

Open build.xml, and add the below Task def and Ant Task.

[taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/]

[deploy url=”${manager.url}”
username=”${manager.username}”
password=”${manager.password}”
path=”/${name}”
war=”file:/${dist.dir}/${name}.war” /]

[target name=”deploy” depends=”package-web” if=”tomcat.home”
description=”unwar into the servlet container’s deployment directory”]

[unwar src=”${webapp.dist}/${webapp.war}”
dest=”${tomcat.home}/webapps/${webapp.name}”/]

[/target]