[ 
https://issues.apache.org/jira/browse/FELIX-954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676117#action_12676117
 ] 

Pavol Juhos commented on FELIX-954:
-----------------------------------

Also thanks for your hints regarding the handling of optional dependencies. 

ad 1): I my case the optional dependencies are not embedded into the bundle, so 
this probably makes no difference
ad 2): I'm not sure if I fully understand what it means that optional 
dependencies are not passed to Bnd, but the problematic import-package 
declarations are probably created because references to optional packages are 
found among regular classes (i.e. those contained in non-optional JARs). For 
example if Bnd scans hibernate-3.2.5.ga.jar it will find references to 
different optional cache providers like OSCache, SwarmCache, ... because there 
are supporting classes for these providers contained in the jar

So the only possible workaround seems to be setting all imports as optional. 
However this seems to have several obvious disadvantages. E.g. how to identify 
imports that should be satisfied by system packages (i.e. JRE packages)? Is is 
a good practice to export all JRE packages as system packages? 

> Import-Package should include packages from optional Maven dependencies with 
> resolution=optional
> ------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-954
>                 URL: https://issues.apache.org/jira/browse/FELIX-954
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.3
>            Reporter: Pavol Juhos
>
> It would be great if maven-bundle-plugin used resolution=optional for 
> packages that are coming from _optional_ Maven dependencies.
> The current behavior causes problems e.g. when embedding libraries with lots 
> of optional dependencies. As described by Detelin Yordanov: "[I]t seems that 
> BND finds the
> references to [the optional packages] and assumes them to be mandatory adding 
> a bunch of imports in the manifest." This can easily result in hundreds of 
> import-package declarations importing packages that are actually not required 
> by the application. In these cases it is not practical to handle this 
> manually in the plug-in / BND configuration.
> This issue was already discussed on felix-users list in Jan 2009 -- see 
> thread "Maven bundle plugin: Is it possible to mark optional Maven 
> dependencies to be imported with resolition=optional"
> http://mail-archives.apache.org/mod_mbox/felix-users/200901.mbox/%[email protected]%3e

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to