4.4.1. Building The Application

4.4.1. Building The Application

Let's look at building the example application and then explore the configuration files in detail.

In Chapter 3, About the Example Applications, we looked at the directory structure of the jsfejb3 sample application. At the command line, go to the jsfejb3 directory. There you will see a build.xml file. This is our Ant build script for compiling and packaging the archives. To build the application, you need to first of all edit the build.xml file and edit the value of jboss-dist to reflect the location where the JBoss Application Server is installed. Once you have done this, just type the command ant and your output should look like this:

[user@localhost jsfejb3]$ ant
Buildfile: build.xml

compile:
    [mkdir] Created dir: /jboss/gettingstarted/jsfejb3/build/classes
    [javac] Compiling 4 source files to /home/skittoli/Desktop/gettingstarted/jsfejb3/build/classes
    [javac] Note: /jboss/gettingstarted/jsfejb3/src/TodoDao.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.

war:
    [mkdir] Created dir: /jboss/gettingstarted/jsfejb3/build/jars
      [war] Building war: /jboss/gettingstarted/jsfejb3/build/jars/app.war

ejb3jar:
      [jar] Building jar: /jboss/gettingstarted/jsfejb3/build/jars/app.jar

ear:
      [ear] Building ear: /jboss/gettingstarted/jsfejb3/build/jars/jsfejb3.ear

main:

BUILD SUCCESSFUL
Total time: 3 seconds

If you get the BUILD SUCCESSFUL message, you will find a newly created build directory with 2 sub-directories in it: