I have a folder of existing bundled jars I need to use as declarative services. I'm aware of how to treat these like typical Eclipse Plugins and have them declared inside of the typical Component.xml file inside of my plugin project OSGI-INF folder, but now I'd like to follow the OSGI Enroute style of coding and load my bundles as Declarative Services inside there. It seems like services are added to the generated Component.xml for you with OSGI Enroute when you add the @Component annotation, but I'm struggling to figure out how to bring in my pre-existing bundles as Declarative Services since they don't have the annotations in them and I can't change their code (plus they don't have poms). Is there some intuitive way of solving this that I'm missing? Enroute seems like a great way to handle OSGI otherwise.
If I understood your question right, then:
@Component
annotation)In that case you could write the XML files for the Declarative Services yourself:
In the end the @Component
annotation is just used to create XML files during the build describing your Declarative Service. If the code for those old service does not change anymore, it would be reasonable to write the XML files by hand.