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

StackOverflow https://stackoverflow.com/questions/18504379

  •  26-06-2022
  •  | 
  •  

Question

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

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top