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

Bug 314452

Summary: Feature Manifest Editor: compute dependencies cause adding plugin even if imported package marked as optional
Product: [Eclipse Project] PDE Reporter: Alexey Markevich <a_markevich>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: minor    
Priority: P3 CC: curtis.windatt.public
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Alexey Markevich CLA 2010-05-26 08:55:30 EDT
Why optional import package from plugin cause creating required plug-in in feature?
1. Create Plug-in project ('plugin')
2. Create Feature project and make reference to 'plugin'
3. In Plug-in Manifest Editor at Dependencies tab add for example 'org.junit' plug-in dependency and set it as optional.
4. In Feature Manifest Editor at Dependencies tab select 'Compute' button - no 'org.junit' dependency appeared.
5. In Plug-in Manifest Editor at Dependencies tab add 'org.junit' import package and set it as optional.
6. In Feature Manifest Editor at Dependencies tab select 'Compute' button - 'org.junit' dependency appeared.
Comment 1 Curtis Windatt CLA 2013-03-19 11:15:33 EDT
What version of Eclipse are you running on.  The feature editor doesn't use the dependency calculator like the product editor, but it should still skip optional imports.  Looking at the code I see a check to skip optional.

org.eclipse.pde.internal.core.feature.Feature.addPluginImports(List<IFeatureImport>, List<IFeatureImport>, IPluginBase)
Comment 2 Curtis Windatt CLA 2013-03-19 11:21:31 EDT
Was looking at another dependency bug and happened upon this one.  Confirmed that optional dependencies are not added as dependencies when computing (Kepler 4.3).  Closing as WORKSFORME.

Create a plug-in with two required bundles, one optional one not.
Create a feature that includes the plug-in
Go to the dependencies page, with no existing dependencies, hit compute
Result: Only the non-optional requirement will be added.