[
https://issues.apache.org/jira/browse/VFS-498?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14269984#comment-14269984
]
Bernd Eckenfels edited comment on VFS-498 at 1/8/15 8:28 PM:
-------------------------------------------------------------
Ok it works, but only if the Bnd tool actually sees those dependencies. The
commons-parent does exclude all dependencies by default, essentially dumbing
down the manifest generation process. I wonder if this is intentional?
If I overwrite the setting the resolution=optional are correctly added (and
version ranges for some of the packages. The later I am not sure if this is a
good idea to introduce it in 2.1, but on the other hand as the import seems
quite broken in 2.0 I guess nobody would mind...)
{code}
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<excludeDependencies combine.self="override">none</excludeDependencies>
</configuration>
</plugin>
{code}
was (Author: b.eckenfels):
Ok it works, but only if the Bnd tool actually sees those dependencies. The
commons-parent does exclude all dependencies by default, essentially dumbing
down the manifest generation process. I wonder if this is intentional?
If I overwrite the setting the resolution=optional are correctly added (and
version ranges for some of the packages. The later I am not sure if this is a
good idea to introduce it in 2.1, but on the other hand as the import seems
quite broken in 2.0 I guess nobody would mind...)
{code}
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<excludeDependencies
combine.self="override">none</excludeDependencies>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<excludeDependencies
combine.self="override">none</excludeDependencies>
</configuration>
</execution>
</executions>
</plugin>
{code}
> OSGI MANIFEST.MF "Import-Package" should be ";resolution:=optional" for Maven
> "optional" dependencies
> -----------------------------------------------------------------------------------------------------
>
> Key: VFS-498
> URL: https://issues.apache.org/jira/browse/VFS-498
> Project: Commons VFS
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Michael Schnell
> Original Estimate: 4h
> Remaining Estimate: 4h
>
> In the Maven "pom.xml" there are several "optional" dependencies like "jsch":
> {quote}
> <dependency>
> <groupId>com.jcraft</groupId>
> <artifactId>jsch</artifactId>
> <optional>true</optional>
> </dependency>
> {quote}
> In the "Import-Package" section of the MANIFEST.MF it should also be
> "optional" like this:
> {quote}
> com.jcraft.jsch;resolution:=optional,
> {quote}
> At the moment all dependencies are always required. This is a problem if you
> want to use VFS in an OSGI environment as you have to install ALL
> dependencies and not only the ones you really need.
> The mechanism creating the MANIFEST should be adjusted to reflect the
> optional dependencies also in the MANIFEST. (Unfortunatelly this could mean
> to list all packages which should be optional).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)