Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

5.4. Configuration and Packaging

We will build the sample application using Ant and explore the configuration and packaging details. If you haven't installed Ant yet, do so now.

5.4.1. Building The Application

Let's look at building the example application and then explore the configuration files in detail.
In Chapter 4, 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, just type the command ant and your output should look like this:
[vrenish@vinux jsfejb3]$ ant
Buildfile: build.xml

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

war:
    [mkdir] Created dir: /home/vrenish/jboss-eap-4.2/doc/examples/gettingstarted/jsfejb3/build/jars
      [war] Building war: /home/vrenish/jboss-eap-4.2/doc/examples/gettingstarted/jsfejb3/build/jars/
      app.war

ejb3jar:
      [jar] Building jar: /home/vrenish/jboss-eap-4.2/doc/examples/gettingstarted/jsfejb3/build/jars/
      app.jar

ear:
      [ear] Building ear: /home/vrenish/jboss-eap-4.2/doc/examples/gettingstarted/jsfejb3/build/jars/
      jsfejb3.ear

main:

BUILD SUCCESSFUL
Total time: 2 seconds
(vrenish@vinux jsfejb3)$
If you get the BUILD SUCCESSFUL message, you will find a newly created build directory with 2 sub-directories in it:
  • classes : containing the compiled class files.
  • jars : containing three archives - app.jar, app.war and jsfejb3.ear.
    • app.jar : EJB code and descriptors.
    • app.war : web application which provides the front end to allow users to interact with the business components (the EJBs). The web source (HTML, images etc.) contained in the jsfejb3/view directory is added unmodified to this archive. The Ant task also adds the WEB-INF directory that contains the files which aren’t meant to be directly accessed by a web browser but are still part of the web application. These include the deployment descriptors (web.xml) and extra jars required by the web application.
    • jsfejb3.ear : The EAR file is the complete application, containing the EJB modules and the web module. It also contains an additional descriptor, application.xml. It is also possible to deploy EJBs and web application modules individually but the EAR provides a convenient single unit.

 
 
  Published under the terms of the Open Publication License Design by Interspire