Magazine
 
ANT
Out put of ant command:

C:\anttest\example2>ant
Buildfile: build.xml
init:
[mkdir] Created dir:
C:\anttest\example2\build\war\WEB-INF
[mkdir] Created dir:
C:\anttest\example2\build\war\WEBINF\
classes
[mkdir] Created dir:
C:\anttest\example2\build\ear\META-INF
build:
[javac] Compiling 1 source file to
C:\anttest\example2\build\src
buildWar:
[copy] Copying 1 file to
C:\anttest\example2\build\war\WEBINF\
classes
[copy] Copying 1 file to
C:\anttest\example2\build\war\WEB-INF
[copy] Copying 1 file to
C:\anttest\example2\build\war
[jar] Building jar:
C:\anttest\example2\build\ear\example2.war
buildEar:
[copy] Copying 1 file to
C:\anttest\example2\build\ear\META-INF
[jar] Building jar:
C:\anttest\example2\example2.ear
all:
BUILD SUCCESSFUL
Total time: 8 seconds
C:\anttest\example2>|

The above process will create example2.ear in c:\anttest\example2 directory. Deploying and testing J2EE application Statrt Jboss 3.2.3 and copy example2.ear file into the JBOSS_HOME/server/default/deploy directory. JBoss application server automatically deploys the application. Open web browse and type http://localhost:8080/ ANT example2 in the web browser. Browse should show the screen something like this:

 

Also try to execute Hello World Servlet by clicking “Click Here to” link on the index.jsp in the browser.

In this lesson you learned how to write build.xml file to automate the process of .ear file creation. Ant utility with help of our build.xml file automatically compiles source code and assembles JEE application for us. Ant utility is
very power full and it reduces the development time significantly.

Oct 2007 | Java Jazz Up | 40
 
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 ,

Download PDF