Build the enterprise with EJB 3, JBoss Seam, and Maven 2

Enterprise resource management with JBoss Seam and Maven 2

1 2 3 4 5 6 7 Page 5
Page 5 of 7

JBoss Seam (core source) POM and file structure

Our Maven project is based on the Registration example that comes with Seam's 2.0.1CR1 download. The core source files were extracted, compiled, and packaged as an EJB. Apart from the large number of source files, the remainder of the project structure features only a few more configuration files. Figure 5 offers an overall view.

Seam project structure
Figure 5. Seam project structure (click to enlarge)

You'll note that this looks similar to the EJBs project structure. The components.xml file in the resources/META-INF directory, shown in Listing 9, contains nothing more than a listing of all Seam-specific components that will be included (and loaded) as part of the framework.

Listing 9. components.xml

<?xml version="1.0" encoding="UTF-8"?>
<components xmlns=""

ejb-jar.xml in this Seam project is actually a file with the entry <ejb-jar></ejb-jar> and nothing more. Because this is the project that will provide Seam components to the rest of the structure, it needs no entries.

One of the more interesting files is faces-config.xml, shown in Listing 10. One point that might strike your is that this is a file that ordinarily appears within a Web project -- specifically, in the WEB-INF directory. You'd also expect the Seam-specific entries within it to be configured by the developer within the application-specific JSF faces-config.xml file. Actually, both of these statements are true, but with a special caveat. This particular file contains the default components Seam will use at system startup -- navigation handlers, view handlers, phase listeners, and so on.

Listing 10. faces-config.xml

<?xml version="1.0"?>
<faces-config version="1.2"

The Javamail.Providers file, shown in Listing 11, is of no consequence in this example. However, if you ever need to add mailing providers to an application, this would be the file to configure to make Seam mail-aware.

Listing 11. Javamail.Providers

# See

protocol=mock; type=transport; class=org.jboss.seam.mock.MockTransport; vendor=JBoss Seam Integration Tests;

The jboss-seam source POM file, shown in Listing 12, looks pretty standard and not that different from what we've already seem. Again, the dependencies section has been tree-collapsed. Because Seam is being compiled from source, there are multiple dependencies, all of whose binaries can be found in the Seam zip (or tar.gz) lib folder, once unpacked.

Listing 12. jboss-seam source POM file

   <name>jboss seam </name>
1 2 3 4 5 6 7 Page 5
Page 5 of 7