<a name="268"></a><a name="wbp06Chapter5P1"></a><span>Chapter 5: </span> Building Java Applications with Ant - Professional Java Tools for Extreme Programming [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Professional Java Tools for Extreme Programming [Electronic resources] - نسخه متنی

Richard Hightower, Warner Onstineet al.

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید











Chapter 5: Building Java Applications with Ant


Overview


Chapter 6, “Building J2EE Applications with Ant,” in which we build a Model 2 application complete with EJBs, servlets, and JSPs.

During the course of this chapter, we will build a “Hello World” example. Because the emphasis is on how to build components with Ant—and not the mechanics of implementing these various components—the example is meant to be as simple as possible. We will package the application and the common JAR, construct a buildfile that creates an applet, and construct a master buildfile that coordinates the entire build.

The source code for the Hello World example is divided into several directories. Each directory has its own Ant buildfile, which contains instructions to compile the components and package the binaries. Each directory also includes the requisite configuration files (such as manifest files). The master Ant buildfile, located in the root directory, calls the other buildfiles and coordinates the entire build.

This divide-and-conquer technique for organizing components into separate directories is quite common with Ant. It may seem like overkill on a simple project like this one, but consider building a system with 50 components. Each component has its own set of deployment descriptors and configuration files, and each component is deployed in different containers. The divide-and- conquer technique becomes necessary to mange the complexity—it also makes it easier to reuse components.

Following is the directory structure for the Hello World project. We will use this same structure for the more complex example in Chapter 6:

Model 2 Hello World root
+---Model
+---Application
+---Applet
+---WebApplication
+---EJBeans

The Model directory holds the common code (in this simple project, only the application will access the common code). The Application directory holds the Java application code, including the manifest file that marks the deployment JAR as executable. The Applet directory holds the applet code. The WebApplication and EJBeans directories are discussed in Chapter 6.

/ 228