ANT is a build tool for java web based application. It is used to clean,compile,create a war and jar files. Create a xml called build.xml under WEB-INF.
<?xml version="1.0" encoding="UTF-8"?> <project name="sample"> <target name="makeJAR"> <mkdir dir="build/jar"/> <jar destfile="build/jar/sample.jar" basedir="build/classes"> </jar> </target> <target name="makeWAR" description="Bundles the application as a WAR file"> <war destfile="sample.war" basedir="WebContent"> </war> </target> </project>
Now build your application. WAR and JAR are created.