Recent Pos

Ant Examples

Facebooktwittergoogle_plusredditpinterestlinkedintumblrmail

ant build script examples eclipse with property

Example#1

Simple Ant example:

HelloWorld.java

 
build.xml

Download this example: Example1.zip
 

Example#2

Using property in build.xml

Note: use the HelloWorld.java from previous example

build.xml

Download this example: Example2.zip
 

Example#3

Using .properties file in build.xml

Note: use the HelloWorld.java from previous example

build.xml

 
build.properties

Download this example: Example3.zip
 

Example#4

Building project and deploying into Tomcat server using Ant

Note: Before run below example, we need to copy servlet-api.jar file from tomcat into our project “WEB-INFlib” folder.

build.xml

 
build.properties

 
HelloWorld.java

 
web.xml

Download this example: Example4.zip
 

Example#5

Building project, deploying and restarting Tomcat server using Ant

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

 
build.xml

 
build.properties

 
HelloWorld.java

 
web.xml

Download this example: Example5.zip

No Comments

Post a Comment