Bug 392455 - [conversion] application.xml is overwritten
Summary: [conversion] application.xml is overwritten
Status: NEW
Alias: None
Product: M2E-WTP
Classification: Technology
Component: Core (show other bugs)
Version: 0.16.0   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 498312 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-19 10:58 EDT by Roberto Sanchez Herrera CLA
Modified: 2017-02-08 13:39 EST (History)
5 users (show)

See Also:


Attachments
Test projects (6.01 KB, application/zip)
2012-10-19 10:58 EDT, Roberto Sanchez Herrera CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Sanchez Herrera CLA 2012-10-19 10:58:15 EDT
Created attachment 222583 [details]
Test projects

I had both  Preferences > Maven  > Java EE Integration > "Generate application.xml under the build directory" and  Preferences > Maven  > Java EE Integration > "Maven Archiver generates files under  the build directory" unchecked. 

I attach a sample workspace consisting on a EAR with a web project. Both have deployment descriptor: the EAR's deployment descriptor has the web module and a security role, and the Web project's deployment descriptor has a context parameter and a list of welcome pages. 

To recreate, I did this: 
1. Uncheck both options under Preferences > Maven  > Java EE Integration 
2. Import the projects in the attached file 
3. Convert the Web project to maven (Configure > Convert to Maven project). Use war for packaging. The deployment descriptor is left untouched (which is fine) 
4. Convert the EAR project to maven, using ear for packaging. The original deployment descriptor is replaced by a new one, which has only the display name. 
So the security roles and the modules are lost. 

This is not a problem with security roles only. Any information in the EAR's deployment descriptor is lost during the conversion. 

In a reply to this in the m2e-wtp-dev mail list, Fred suggested two approaches:

"I think there are 2 non-exclusive approaches to the problem :
- either add some preferences to keep the original application.xml during conversion (meaning adding <generateApplicationXml>false<generateApplicationXml> to the pom.xml)
- the ear conversion participant should at least extract the security roles from the original application.xml and convert them as maven-ear-plugin configuration. However, the modules would still be removed, since the conversion mechanism doesn't currently support dependency conversion"

http://dev.eclipse.org/mhonarc/lists/m2e-wtp-dev/msg00065.html
Comment 1 Fred Bricon CLA 2016-07-21 16:44:45 EDT
*** Bug 498313 has been marked as a duplicate of this bug. ***
Comment 2 Fred Bricon CLA 2016-07-25 11:14:12 EDT
*** Bug 498312 has been marked as a duplicate of this bug. ***
Comment 3 Rajiv Senthilnathan CLA 2017-02-08 13:39:47 EST
Is there any update on a fix for this? Still interested in a fix. Thanks