[
https://issues.apache.org/jira/browse/FELIX-954?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676103#action_12676103
]
Pavol Juhos commented on FELIX-954:
-----------------------------------
First of all, thank you for such a quick response.
Stuart is right that I'm trying to create something like a "mega-bundle" which
contains (but does NOT export) a large number of packages. This is supposed to
be the first step in an incremental adoption of OSGi on an existing project.
The big bundle should embed all Maven dependencies for now. Later we plan to
take out dependencies (and also subcomponents) one by one as separate bundles.
Similar approach might be also relevant for other projects considering
migration to OSGi, right?
This is the configuration of maven-bundle-plugin that is used to create the
bundle (special treatment of hsqldb and jdom dependencies is there to prevent
Bnd errors caused by classes in default package -- see
https://issues.apache.org/jira/browse/FELIX-807):
<configuration>
<instructions>
<Private-Package>com.foo.bar.server.*,com.foo.misc.*</Private-Package>
<!-- embed all compile and runtime scope dependencies (except our Bar
bundles) -->
<Embed-Dependency>*;scope=compile|runtime;artifactId=!bar-module-a|bar-module-b|hsqldb|jdom</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Bundle-ClassPath>.,{maven-dependencies},hsqldb-fixed.jar,jdom-fixed.jar</Bundle-ClassPath>
<Include-Resource>{maven-resources},{maven-dependencies},${project.build.directory}/hsqldb-fixed.jar,${project.build.directory}/jdom-fixed.jar</Include-Resource>
</instructions>
</configuration>
> 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.