The purpose of an EAR project is to provide a way to package several other
projects (Dynamic Web and EJB) into a single archive so that they can be deployed
together.
There are several ways that an EAR project can get created and get other projects
associated with it. Probably the simplest way is to request one when creating a
Dynamic Web or EJB project. During the dialog which creates these types of projects
there is a checkbox that allows you to associate the new project with an EAR project.
When this checkbox is checked then the EAR Project Name: text box is
activated which allows you to enter the name of (or select from a list) an EAR
project. This EAR project will be used when packaging the project being created
for deployment. If you enter the name of an EAR project that does not exist, it
will be created.
A description of another way to create EAR projects follows.
Right click in the Package Explorer View. Select: New > Project Select: J2EE > Enterprise Application Project Click: Next
This selection will cause WTP to create an EAR project. These types of projects can be used to package Dynamic Web and EJB projects into an EAR file for deployment.
Enter: Project name: Select: Target runtime: (if current value incorrect or missing) Click: Next
This dialog names and provides some additional information for the new EAR project.
Project name:
Enter the name you want the project known by in this text box. It is strongly
recommended that you avoid using spaces in this name as that can cause problems
on some platforms.
Directory:
If you uncheck the Use default checkbox, you can then enter into this text box,
the directory where the EAR project should be created. The default value provided for
this field puts the project content inside the Eclipse workspace. If you choose to
specify a location other than the default, then you should not specify a location inside
the Eclipse workspace.
Target runtime:
This identifies one of the server runtimes currently defined in WTP. It is used
as part of the project classpath so that the various Eclipse editors that provide
real time error checking and auto completion facilities will have definitions of the
interfaces and classes referenced in the users projects. When a project is actually
associated with a defined server and then published to that server, it is rebuilt
using that servers runtime so that the deployed archives are built with the correct
Jar files for the server where it was deployed. Some of this is speculation but it
but it seems to explain the observed behavior of WTP. There may be other reasons for
providing this value at this stage but I do not know what they are.
Click: Next
This dialog lets you choose which facets should be used with your project. A facet represents a collection of functionallity and when selected may enable builders to be run when the project is built. In this case extra builders are not needed for this type of project.
Check Modules from provided list that should be packaged in the EAR. Click: Finish
This dialog allows you to choose which Dynamic Web and EJB projects should
be associated with this EAR project. All modules associated with this EAR
project will be packaged and deployed its EAR file when being published to an
application server.