3.10. Building and Running the Layered Application

The Ant buildfile for the layered application is shown in Listing 3.18. This buildfile is named layered.xml and located in the nfl directory on the CD.

In addition to the <compile>, <clean>, and <test> targets that were present in the original version of the buildfile, we add a new target named <jar>. This target creates a JAR file of all the application classes, which makes it easier to distribute the application. The <test> target has been modified to run the application out of the JAR file.

The <jar> target uses Ant's built-in <jar> task to accomplish its work. The <jar> task has a number of attributes that can be specified; we are using four of the more commonly used in this example. The ...

Get J2EE™ and JAX™: Developing Web Applications and Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.