The compiling, packaging, and deploying of the web application is
done in the Eclipse IDE with an Ant build.xml file. Develop
an Ant build.xml file that consists of targets to compile
the JBossServlet.java file and package and deploy the
webapp.war web application. The build.xml file is
listed below:
The build.xml file has the properties listed in the
following table.
Property
Description
build
The build directory used to build the web
application.
src
The src directory has the source files for the web
application.
jboss.deploy
The JBoss directory in which the web application is
deployed.
dist
The directory in which the web application .war file is
generated.
j2sdkee
The J2sdkee directory.
build.xml also has the following targets:
Target
Description
init
The initialization target; the target to create the web application
directories.
compile
The target to compile the web application.
webapp
The target to generate the .war file.
The debug attribute of the javac task
in the build target is set to true to
enable compilation in debug mode. By compiling an
application in debug mode, the line number that generates the
exception in a JBoss server application gets displayed in Eclipse's
Debug perspective.
Back to Eclipse
Create a new project in the Eclipse IDE. Select File -> New
-> Project, as shown in Figure 1.