Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 353484

Summary: Incorrect value for Service-Component header when bundle has a custom root
Product: [Eclipse Project] PDE Reporter: Kaloyan Raev <kaloyan>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: contact, curtis.windatt.public
Version: 3.7   
Target Milestone: 3.8 M3   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Bug Depends on:    
Bug Blocks: 361148    

Description Kaloyan Raev CLA 2011-08-01 06:11:40 EDT
Steps to reproduce:
1. Create a new OSGi Bundle/Plug-in project with Bundle Root that is different from the Project Root. For example, create a new Web Application Bundle (WAB) project: http://wiki.eclipse.org/Libra/Getting_Started#Create_new_Web_Application_Bundle. In this case the Bundle Root is the /WebContent folder.
2. Create an OSGI-INF folder under the Bundle Root folder. In the case of WAB example /WebContent/OSGI-INF. 
3. Call the New Component Definition wizard and create a new component.xml under the OSGI-INF folder.

The component.xml is correctly created, but the MANIFEST.MF is incorrectly modified. The Service-Component header points to the component.xml, but the path is relative the Project Root instead of to the Bundle Root. 

In the WAB example, it looks like:

  Service-Component: WebContent/OSGI-INF/component.xml

while it should look like:

  Service-Component: OSGI-INF/component.xml
Comment 1 Curtis Windatt CLA 2011-09-30 14:53:35 EDT
Fixed in master.  See DSCreationOperation.java.  The file path that is entered in the manifest is now made relative to the bundle root rather than the second segment of the filepath.
Comment 2 Kaloyan Raev CLA 2011-10-16 07:40:29 EDT
Thank you for the fix, Curtis! I tested it with Juno and it works perfectly. 

Is it possible to downport the fix for Indigo SR2? This bug affects and adopter's scenario that is currently being developed on top of the Indigo stream.
Comment 3 Curtis Windatt CLA 2011-10-25 14:23:38 EDT
Verified in I20111021-1625 and by the original reporter.