Bug 255904 - Imported EAR projects are not setup as JST EAR projects correctly.
Summary: Imported EAR projects are not setup as JST EAR projects correctly.
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: IAM (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Carlos Sanchez CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2008-11-19 17:01 EST by Joakim Erdfelt CLA
Modified: 2012-01-05 13:10 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Erdfelt CLA 2008-11-19 17:01:20 EST
When importing a maven EAR project, the JST (EAR) facets are not configured.
Comment 1 Carlos Sanchez CLA 2009-05-12 13:21:39 EDT
You need three files to get a project recognized as an EAR in RAD.

1. .project file need these builders and natures:
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>

2. in the .settings folder directly inside of the EAR's root directory must contain these 2 files:
org.eclipse.wst.common.project.facet.core.xml
org.eclipse.wst.common.component

3. org.eclipse.wst.common.project.facet.core.xml must contain:
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="was.base.v61"/>
<fixed facet="jst.ear"/>
<installed facet="jst.ear" version="1.4"/>
<installed facet="com.ibm.websphere.coexistence.ear" version="6.1"/>
<installed facet="com.ibm.websphere.extended.ear" version="6.1"/>
</faceted-project>

It is important that you specify the correct version of the EAR that you are using. For example, if you using a JavaEE 5 project you should specify the version of the EAR as:
<installed facet="jst.ear" version="5.0"/>

3. org.eclipse.wst.common.component must contain:
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="testEAR">
<wb-resource deploy-path="/" source-path="/"/>
</wb-module>
</project-modules>

Where the deploy-name, deploy-path, and source-path all match the name of your EAR and it's project layout.
Comment 2 Carlos Sanchez CLA 2009-06-24 01:40:50 EDT
Initial implementation has been committed and is available in the development update site.

To have Eclipse recognize the application.xml file it needs to be in /META-INF/application.xml, so you'd need to add to the pom' EAR plugin configuration

<configuration>
  <generatedDescriptorLocation>${basedir}/META-INF</generatedDescriptorLocation>
...

so Maven generates the application.xml in the right place
Comment 3 Carlos Sanchez CLA 2010-01-19 14:31:53 EST
close resolved bugs