Plans to support "Require-Bundle" in maven-bundle-plugin

2.7k views Asked by At

Are there plans to support "Require-Bundle" in maven-bundle-plugin, even if its not the recommended OSGi way. There are situations where it makes sense to use "Require-Bundle", for example to merge split packages.

2

There are 2 answers

4
Balazs Zsoldos On

You can specify Require-Bundle MANIFEST header in the instructions. E.g.:

<instructions>
    <Require-Bundle>a.b.c</Require-Bundle>
</instructions>

However, version range of the required bundle will not be appended automatically, so you have to specify it manually if that is necessary.

0
Neil Bartlett On

Require-Bundle is supported by the bundle-plugin, just like all OSGi headers plus any other arbitrary headers that you want to use. Just write them in the XML:

<Require-Bundle>
    org.example.foo; bundle-version=3.0,
    org.example.bar; bundle-version=1.0
</Require-Bundle>
<My-Extension-Header>
    blah blah blah
</My-Extension-Header>