Search code examples
javagradleosgiapache-felixdeclarative-services

Gradle not generating SERVICE_COMPONENT when using DS Annotations


I'm using Declarative Services annotations in my project along with gradle.

I have specified the respective annotations (@Component etc) in my Component classes. I have also added the dependency for the felix scr annotations projects in the gradle file. But, when I build my project the component xml file is not getting generated and neither is the Service-Component header in the Manifest.MF file.

I'm using the 'osgi' plugin in gradle for generating the OSGI bundle.

Does gradle provides this support? It is possible in maven by the use of the maven-scr plugin. Do we have any such plugin in gradle?

Any help would be appreciated.


Solution

  • I don't believe the OSGi support included with gradle uses bnd which processes the DS annotations into the xml documents and Service-Component header. The bnd project has its own gradle plugin, BndPlugin, which is available in the 2.4.0.M1 milestone 1 build of bnd.