How do I add the Service-Component header to the package manifest file in OSGI declarative services?

I am using OSGI Advertiser Services (SCR) to create a component package. I am not interested in using annotation-based XML component files generated by maven-scr-plugin. I am writing a .xml component by hand. But I need a Service-Component header to be added to the MANIFEST file. I am using the maven-bundle-plugin to build the osgi package, any instructions I can give in the plugin config that will add such a header to the manifest file?

some useful links:



BND-Service Component



source to share

1 answer

Any header that can be found in the manifest file can be included in the bundle plugin configuration as an element. For example,



The line <extensions>true</extensions>

includes arbitrary custom headers, although I believe the Service-Component is included in the set of known headers, so it's not needed here.



All Articles