Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312719 - Modules added into an EAR shouldn't go into /lib by default
Summary: Modules added into an EAR shouldn't go into /lib by default
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.2 RC2   Edit
Assignee: Aidyl Kareh CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-12 17:20 EDT by Aidyl Kareh CLA
Modified: 2010-05-19 23:56 EDT (History)
6 users (show)

See Also:
david_williams: pmc_approved+
amkareh: pmc_approved? (raghunathan.srinivasan)
amkareh: pmc_approved? (naci.dai)
amkareh: pmc_approved? (deboer)
amkareh: pmc_approved? (neil.hauge)
amkareh: pmc_approved? (kaloyan)
cbridgha: review+
jsholl: review+


Attachments
Proposed Patch (5.70 KB, patch)
2010-05-12 17:27 EDT, Aidyl Kareh CLA
no flags Details | Diff
Updated Proposed Patch (5.69 KB, patch)
2010-05-12 17:38 EDT, Aidyl Kareh CLA
no flags Details | Diff
Icon (647 bytes, application/zip)
2010-05-12 17:42 EDT, Aidyl Kareh CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aidyl Kareh CLA 2010-05-12 17:20:52 EDT
Build Identifier: WTP 3.2

The Deployment Assembly properties page for EAR projects currently set the deploy path of module project to '/lib/ModuleName'. If you add the modules during EAR project creation the deploy path of modules are set to '/ModuleName'. I would expect the deployment assembly page to recognize a (non-Utility) Java EE module and default to placing it in the root directory.

Reproducible: Always

Steps to Reproduce:
1. Create an EAR project with all default modules
2. Right-click on new EAR project and open the Properties page.
3. In the Deployment Assembly preference page, remove one of the module project references.
4. Click on 'Add...' button to open 'New Reference Wizard', and select the 'Project' node and click next.
5. Select the project you just remove and click 'Finish' (the deploy path is now '/lib/ModuleName' instead of '/ModuleName')
Comment 1 Aidyl Kareh CLA 2010-05-12 17:27:58 EDT
Created attachment 168275 [details]
Proposed Patch

This patch adds a CustomEARProjectReferenceWizardFragment class which extends the ProjectReferenceWizardFragment class and overwrites the RuntimePath value of module projects to set it to the root directory.
Comment 2 Aidyl Kareh CLA 2010-05-12 17:38:40 EDT
Created attachment 168281 [details]
Updated Proposed Patch

Same as previous patch but this patch changes the display of the 'Project Reference' node to be 'Project' (for consistency).
Comment 3 Aidyl Kareh CLA 2010-05-12 17:42:18 EDT
Created attachment 168282 [details]
Icon

For consistency with other 'Project' nodes displayed in the 'New Reference Wizard', the prj_obj.gif icon (obtained from org.eclipse.wst.common.modulecore.ui) needs to be added.
Comment 4 Chuck Bridgham CLA 2010-05-17 11:28:21 EDT
approved
Comment 5 Aidyl Kareh CLA 2010-05-17 16:36:47 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug"
(requested by an adopter) please document it as such. 

Currently when you add a project reference using the Deployment Assembly properties page for EAR projects, the deploy path is set to '/lib/ModuleName'. If you add the modules during EAR project creation the deploy path of modules are set to '/ModuleName'. Having the deploy path be '/lib/ModuleName' would mean that the contents of that module are put on the classpath for all other modules to see. The deployment assembly page should recognize a (non-Utility) Java EE module and default to placing it in the root directory (the same deploy path value that is set during project creation where modules are added to an EAR).


    * Is there a work-around? If so, why do you believe the work-around is
insufficient? 

The user can change the default deploy path value using the Deployment Assembly properties page. However, the default value when adding a Java EE module references should be consistent with adding modules during project creation by placing it in the root directory.


    * How has the fix been tested? Is there a test case attached to the
bugzilla record? Has a JUnit Test been added? 

Manually tested deployment assembly window on different scenarios.


    * Give a brief technical overview. Who has reviewed this fix? 

This fix adds a CustomEARProjectReferenceWizardFragment class which extends the ProjectReferenceWizardFragment class and overwrites the RuntimePath value for Java EE module projects to set it to the root directory instead of under the '/lib' folder. An icon was also added so that the display of the 'Project' node in the 'New Reference Wizard' is consistent with the default. Chuck Bridgham has reviewed this patch.


    * What is the risk associated with this fix? 

I believe the risk is minimal since the fix only modifies the default deploy path value when adding project references using the deployment assembly preferences page on an EAR project. This default deploy path value can always be changed by the user using deployment assembly preferences page.
Comment 6 David Williams CLA 2010-05-17 19:04:19 EDT
This sounds important, and I'd have no reason to object ... but, can we get some wider review before committing? 

Rob, does this look right and fit your use cases? 

Perhaps Kaloyan is able to review?
Comment 7 Rob Stryker CLA 2010-05-18 02:34:36 EDT
This looks like it should be perfectly acceptable =]
Comment 8 David Williams CLA 2010-05-18 06:25:52 EDT
ty
Comment 9 Jason Sholl CLA 2010-05-19 12:10:12 EDT
code checked into head for wtp 3.2 rc2