220.127.116.11 Building the Application
To build the application, please run the build.sh script from your local source code root directory
$ cd ~/myApp
The build script will automatically determine which files have to be re compiled or re copied to
the deployment directory that you have specified in the build.xml file. When you use build.sh the
first time, the make utility Ant will create the whole directory structure from scratch.
The build.xml file and the source code directories are organized in a way that the Servlet API
Specification V2.2 compliant Web application hierarchy is generated automatically. This
standard directory layout is shown in Figure 6.
When building the application, you may also specify an optional parameter to control the build
$ ./build.sh [parameter]
). The available options are shown in the table below.
Generates the deployment directory structure.
Removes the deployment home directory structure.
The default; Compiles/copies the project to the deployment home.
Generates the Java documentation.
Executes clean, prepare, compile, and javadoc consecutively to re build all.
Generates the WAR file for the application; a Web archive is a compressed file that
contains the whole Web application in a single file, conforming to the Servlet API
Specification V2.2. The Web archive is used to easily distribute and deploy an
application. The dist command also generates a JAR file of the source code.
Table 4: Application Build Options
Eventually, you may wish to modify the provided build.xml file, for example to generate the Java
documentation in another directory, or to change the javac compiler settings (turn optimization
on, for example). The Apache Ant documentation explains the available XML tags and attributes
that make up the build script in the Ant reference documentation, which can be found here: