Bug 222473 - Create EAR version based on the version of modules to be added
Summary: Create EAR version based on the version of modules to be added
Status: CLOSED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: jst.ws (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: Andrew Mak CLA
QA Contact: Kathy Chan CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 220371
  Show dependency tree
 
Reported: 2008-03-12 16:31 EDT by Kathy Chan CLA
Modified: 2008-04-25 15:09 EDT (History)
0 users

See Also:


Attachments
patch (10.54 KB, patch)
2008-03-25 16:44 EDT, Andrew Mak CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kathy Chan CLA 2008-03-12 16:31:20 EDT
With the fix for bug 220371, we create the highest level of EAR that the server runtime can support.  However, we would not accurately have that information until the server is created, which is done later on in the install phase, not during Assemble phase when the EAR is created.

So, instead, we should try to create the EAR version that is compatible with the modules to be added to the EAR (similar to how defaulting is done in J2EE wizard when a Web project is created).

Once this fix is done, then the patch for 220371 can be committed.
Comment 1 Kathy Chan CLA 2008-03-24 12:32:11 EDT
Jason suggested looking at NewProjectDataModelFacetWizard in org.eclipse.wst.web.ui.  

In the constructor, you will see how the default is loaded up using the working copy; ie. getFacetedProjectWorkingCopy().setFixedProjectFacets( this.template.getFixedProjectFacets() ); 
There is a method on there to set the primary runtime. I suggest you put a few breakpoints in the FacetdProjectworkingCopy and see how the presets are figured out. I don't know the exact code paths you need to replicate, but this is the general area of code you need to be looking at. 
Comment 2 Andrew Mak CLA 2008-03-25 16:44:53 EDT
Created attachment 93495 [details]
patch

added getRequiredEARFacetVersions(IProject) utility function to get the correct EAR version.
Comment 3 Kathy Chan CLA 2008-03-26 13:23:30 EDT
Patch committed and released to HEAD as v200803261717.
Comment 4 David Williams CLA 2008-04-24 00:44:32 EDT
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword. 
Comment 5 Kathy Chan CLA 2008-04-25 15:09:58 EDT
Verified on WTP 3.0 04/15 driver.