2

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

sancho21
  • 3,511
  • 1
  • 39
  • 45
  • I don't get it... these headers would only be present in your generated manifest if they were specified explicitly in the POM, e.g. `...`. So just remove those entries... – Neil Bartlett Aug 29 '13 at 08:41
  • You should try it with version 2.3.7. I even added empty to prevent the entry. Sadly, it failed. – sancho21 Aug 29 '13 at 09:28
  • 1
    I'm one of the developers of bnd. I know that no version of bnd automatically adds this header. So I'm very curious where it might be coming from. – Neil Bartlett Aug 29 '13 at 10:20
  • @NeilBartlett, I see the same problem with version 2.3.7 of bundle-plugin. Import-Service and Export-Service are added to header automatically. – mhshams Nov 12 '14 at 00:30
  • @mhshams Version 2.3.7 of maven-bundle-plugin is over two years old. But still I don't know of any version that would add Import/Export-Service automatically, without it being explicitly specified in either the POM or an ancestor POM. – Neil Bartlett Nov 12 '14 at 22:10

1 Answers1

7

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.

splatch
  • 1,547
  • 2
  • 10
  • 15