osgifuseesb

How to configure maven-bundle-plugin to exclude Import-Service and Export-Service?


I use maven-bundle-plugin to create OSGi compliance jars. It generates expected OSGi MANIFEST, except Import-Service and Export-Service.

According to http://wiki.osgi.org/wiki/Import-Service, using Import-Service is deprecated. No wonder I failed to start a consumer bundle in distributed fabric mode (cluster). The bundle's MANIFEST contains Import-Service entry which causes it to wait (grace period). It started perfectly as I remove that entry manually.

So, how to configure maven-bundle-plugin to exclude Import-Service and Export-Service from it's generated JARs? It's really troublesome if I have to remove the entry manually.

Thanks


Solution

  • Inside instructions element for plugin configuration you may add:

    <_removeheaders>Import-Service,Export-Service</_removeheaders>
    

    This is equivalent of -removehaders flag in bnd. Instruction itself is described on bnd website.