6. 6/6/13 ANT - Build Tool
file:///D:/codin/ant/ant01.html 6/8
Note: use HelloWorld.java, web.xml from previous example.
Note: Before run below example, we need to copy servlet-api.jar and catalina-ant.jar
files from tomcat into our project "WEB-INFlib" folder.
Step 1: Tomcat Authentication
-First add an user with adminstrator access right for Tomcat. To add Tomcat user, edit
this file - "%TOMCAT_PATH%/conf/tomcat-users.xml".
tomcat-users.xml
<?xmlversion='1.0'encoding='utf-8'?>
<tomcat-users>
<rolerolename="manager"/>
<rolerolename="admin"/>
<userusername="admin"password="password"
roles="admin,manager"/>
</tomcat-users>
build.xml
<projectname="LoginApplication"default="war">
<propertyfile="build.properties"/>
<!--defineclasspathjars-->
<pathid="compile.classpath">
<filesetdir="${web.lib.dir}">
<includename="*.jar"/>
</fileset>
</path>
<targetname="init"depends="clean">
<mkdirdir="${build.classes.dir}"/>
<mkdirdir="${dist.dir}"/>
</target>
<targetname="clean">
<deletedir="${build.classes.dir}"/>
<deletedir="${dist.dir}"/>
</target>