EJB or web application modules can be deployed either by themselves or as a part of an enterprise application.
Likewise, Java application clients can be either regular Java desktop applicaitons, or can be
full Java EE application client modules. Adding an EJB module, web module, or application
client module to an enterpirse application lets you further configure the way those modules interact
with each other.
When you add a module to an enterprise application, the IDE does the following:
Lists the module under the enterprise application's J2EE Modules node.
Adds the module project to the enterprise application project's list of
required projects. This means that the module project is cleaned and built
whenever you clean and build the enterprise application project.
Adds a module reference to the enterprise application's general deployment
descriptors. If the target server is the Sun Java System Application Server,
the IDE also adds the reference to the server-specific deployment descriptor.
Packages the module's build output (JAR file or WAR file) into the enterprise
application's EAR file when building the project.
To add an existing module to an enterprise application:
Open the module project and the enterprise application project.
In the Projects window, right-click the enterprise application node for
the J2EE application and choose Add J2EE Module.
In the dialog box, select the module and click OK.
You can only add to an enterprise application. Since the build and deploy process
for is not controlled by the IDE, you cannot add a free-form project
to an enterprise application.