blob: 59ccbf7798ed8b5d8809878572e329a76a0d8eb9 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2006" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="task" name="DC.Type" />
<meta name="DC.Title" content="Adding a facet to a J2EE project" />
<meta name="abstract" content="This topic explains how to add a facet to an existing project in your workspace." />
<meta name="description" content="This topic explains how to add a facet to an existing project in your workspace." />
<meta content="projects, facets, adding, removing, overview, J2EE development, project facets, J2EE modules" name="DC.subject" />
<meta content="projects, facets, adding, removing, overview, J2EE development, project facets, J2EE modules" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/cjearproj.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/tjear.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/tjappproj.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/tjrar.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="taddingfacet" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<title>Adding a facet to a J2EE project</title>
</head>
<body id="taddingfacet"><a name="taddingfacet"><!-- --></a>
<h1 class="id_title">Adding a facet to a J2EE project</h1>
<div class="id_taskbody"><p class="id_shortdesc">This topic explains how to add a facet
to an existing project in your workspace.</p>
<div class="id_context"><p class="anchor_topictop">Facets
define characteristics and requirements for projects. 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.</p>
<p>You
can add facets only to J2EE projects and other types of projects that are
based on J2EE projects, such as enterprise application projects, dynamic Web
projects, and EJB projects. You cannot add facets to a Java project or plug-in
project, for example. Typically, a facet-enabled project has at least one
facet when it is created, allowing you to add more facets if necessary. For
example, a new EJB project has the EJB Module facet. You can then add other
facets to this project like the EJBDoclet (XDoclet) facet.</p>
<p>Some facets
require other facets as prerequisites. Other facets cannot be in the same
project together. For example, you cannot add the Dynamic Web Module facet
to an EJB project because the EJB project already has the EJB Module facet.
Some facets can be removed from a project and others cannot.</p>
<p>New projects
generally have facets added to them when they are created. To add another
facet to a project that already exists, follow these steps:</p>
</div>
<ol class="id_steps">
<li class="stepexpand"><span>In the Project Explorer view, right-click the project and then
click <span class="uicontrol">Properties</span>.</span></li>
<li class="stepexpand"><span>In the Properties window, click <span class="uicontrol">Project Facets</span>.</span>
The Project Facets page lists the facets in the project.
</li>
<li class="stepexpand"><span>Click <span class="uicontrol">Add/Remove Project Facets</span>.</span></li>
<li class="stepexpand"><span>In the Add/Remove Project Facets window, select the check boxes
next to the facets you want this project to have and select a version number
for each facet.</span> <div class="p">Only the facets that are valid for the project
are listed:<ul>
<li>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.</li>
<li>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.</li>
</ul>
You can find out more about the requirements and limitations for each
facet by right-clicking the facet name and then clicking <span class="uicontrol">Show Constraints</span>.</div>
<p>You
can also choose a preset combination of facets from the <span class="uicontrol">Presets</span> list.</p>
</li>
<li class="stepexpand"><span>To remove a facet, clear its check box.</span> Not all facets
can be removed.</li>
<li class="stepexpand"><span>If you want to limit the project so it will be compatible with
one or more runtimes, click the <span class="uicontrol">Show Runtimes</span> button
and select the runtimes that you want the project to be compatible with.</span>
For more information on runtimes, see <a href="tjtargetserver.html" title="When you develop J2EE applications,&#10;you can specify the server runtime environments for your J2EE projects. The&#10;target server is specified during project creation and import, and it can&#10;be changed in the project properties. The target server setting is the default&#10;mechanism for setting the class path for J2EE projects.">Specifying target servers for J2EE projects</a>.
</li>
<li class="stepexpand"><span>Click <span class="uicontrol">Finish</span>.</span></li>
<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
</ol>
<div class="id_postreq"><p class="anchor_topicbottom" />
</div>
</div>
<div><div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../topics/cjearproj.html" title="An enterprise application project ties together the resources that are required to deploy a J2EE enterprise application.">Enterprise application projects</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="../topics/tjear.html" title="">Creating an enterprise application project</a></div>
<div><a href="../topics/tjappproj.html" title="You can use a wizard to create a new application client project and add it to a new or existing enterprise application project.">Creating an application client project</a></div>
<div><a href="../topics/tjrar.html" title="A connector is a J2EE standard extension mechanism for containers to provide connectivity to enterprise information systems (EISs).">Creating a connector project</a></div>
</div>
</div>
</body>
</html>