I want use Ant to automate build, deployment,starting & stopping server of applications. I'm able to build the application through Ant and copied the war file into the Tomcat webapps directory.
On the Internet, I found this article which contains more code to start and stop Tomcat. Since I can successfully deploy without those, I was wondering why they are there.
The code for my build.xml is below.
<?xml version="1.0"?>
<project name="Test" default="build-war">
<property file="build.properties"></property>
<target name="build-war" depends="clean">
<war destfile="Test.war" webxml="${web.dir}/WEB-INF/web.xml" >
<fileset dir="${web.dir}">
<include name="**/*.*"/>
</fileset>
<classes dir="${build.dir}/classes"></classes>
</war>
<copy todir="${deploy.path}" preservelastmodified="true">
<fileset
dir=".">
<include name="*.war"/>
</fileset>
</copy>
</target>
<target name="clean" description="Clean Test war directories">
<delete>
<fileset dir="${deploy.path}">
<include name="Test.war"/>
</fileset>
</delete>
</target>
</project>