Open madhugarimilla opened 8 years ago
There is no way to automatically detect JAX-RS annotations. This is by OSGi design. You must register your resources using the Activator as you are doing now. You can also register the resources using DS (declarative services). I find it much easier to use DS.
@madhugarimilla as @BryanHunt stated you do have to register your resources for them to be accessible for scanning. As @BryanHunt pointed out Declarative Services will simplify things for you. Look at the org.osgi.service.component.annotations.Component annotation.
Another framework that can register services is blueprint. It has coule of advantages over DS. For example you can inject beans from the same bundle and thed do not have to be registered as a service for this.
I was able to expose my Rest api by following the examples provided in this project. Is it mandatory to register all my rest services with the bundle context inside Activator explicitly? is there a mechanism that automatically detects and publishes all these Rest resources just by the @Path annotations?