[
https://issues.apache.org/jira/browse/FELIX-954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055535#comment-13055535
]
Stuart McCulloch commented on FELIX-954:
----------------------------------------
I think it is worth attempting to improve the current situation - right now we
pass a simple classpath onto bnd which doesn't include any of the additional
metadata available to us from maven. No maven versions / version ranges, no
indication of optionality, etc. If we could pass this metadata onto bnd in a
tool agnostic way it would have more information about the project and its
dependencies and there would be less need to duplicate information in the POM
(ie. once in the dependency section, and again in the bnd instructions).
Optional dependencies are there for several common use-cases in maven, as are
optional package dependencies in OSGi (especially when it comes to wrapping
legacy jars that can be used in many different environments). Since there is an
overlap between these use-cases it makes sense to try and make life easier for
the developer rather than just give up and say it's too hard.
I'm also not sure how optional dependencies will "wreak havoc" with resolvers
or OBR, perhaps you could give an example?
> 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: New Feature
> Components: Maven Bundle Plugin
> Affects Versions: maven-bundle-plugin-1.4.3
> Reporter: Pavol Juhos
> Fix For: maven-bundle-plugin-2.4.0
>
>
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira