Adding a facet to a Java EE project

This topic explains how to add a facet to an existing project in your workspace.

When you add a facet to a project, that project is configured to perform a certain task, fulfill certain requirements, or have certain characteristics. For example, the EAR facet sets up a project to function as an enterprise application by adding a deployment descriptor and setting up the project's classpath.

New projects generally have facets added to them when they are created. To add another facet to a project that already exists, complete the following steps:

  1. In the Project Explorer view of the Java™ EE perspective, right-click the project and then select Properties.
  2. Select the Project Facets page in the in the Properties window. This page lists the facets in the project and their versions.
  3. Click Modify Project and select the check boxes next to the facets you want the project to have.
    Only the facets that are valid for the project are listed:
    • The list of runtimes selected for the project limits the facets shown in the list. Only the facets compatible with all selected target runtimes are shown.
    • The currently selected facets and their version numbers limit the other facets shown in the list. For example, if the project contains the Dynamic Web Module facet, the EJB Module facet is not listed because these two facets cannot be in the same project.
    You can find out more about the requirements and limitations for each facet by right-clicking the facet name and then clicking Show Constraints.

    You can also choose a preset combination of facets from the Presets list.

  4. Choose a version number for the facet by clicking the current version number and selecting the version number you want from the drop-down list.
  5. Optional: To remove a facet, clear its check box. Not all facets can be removed.
  6. Optional: If you want to limit the project so it will be compatible with one or more runtimes, click on the Runtimes tab and select the runtimes that you want the project to be compatible with. For more information on runtimes, see Specifying target servers for J2EE projects.
  7. Click Finish to exit the Modify Faceted Project dialog and then click OK.

Related concepts
Project facets
Related tasks
Changing the Java compiler version for a Java EE project
Changing the version of a facet