I have created a service org.testsite.myconfig.MyConfigService. Now I have to call this service in another service com.aem.DeviceDetection. As MyConfigService service doesn't exist in Adobe repository, how should this dependency be managed in Maven project. Are there special entries which need to be added in pom.xml for this project?
Please refer to these articles for your references.
//This articles covers how to create and deploy an Adobe CQ OSGi bundle that consumes data from a third-party Restful web service.
Thanks but my problem is slightly different from these references. These links tell how to convert a normal JAR file to OSGI bundle but in my case i already have the OSGI bundle.
I have an OSGI bundle A (custom) which I want to import to another OSGI bundle B. As this bundle A is not in Adobe repository, i am keeping bundle A jar file under the lib folder of project B in eclipse. It works till this point (First question is: Is this the best way of adding custom OSGI Bundle in eclipse project?)
After this I run mvn clean install so that I can create bundle file from Project B but it fails saying that
[ERROR] Failed to execute goal on project B-bundle: Could not resolve dependencies for project com.B-bundle:bundle:1.0-SNAPSHOT: Could not find artifact org.testsite.myconfig:org.testsite.myconfig.MyConfigService:jar:1.0.0 in adobe (http://repo.adobe.com/nexus/content/groups/public/) -> [Help 1]
Clearly when running above command, Maven doesn't see the dependency A added through the lib folder of project B.
So another question is , what can i do to resolve above problem?
I have an OSGI bundle A (custom) which I want to import to another OSGI bundle B. As this bundle A is not in Adobe repository. I am keeping bundle A jar file under the lib folder of project B in eclipse. It works till this point (First question is: Is this the best way of adding custom OSGI Bundle in eclipse project?)
While building the Project A can install the OSGI bundle in AEM. By using that reference u can build the Project B. keeping the jar file in library is not a good idea.
You can place a bundle A jar in a repository that you are using. Add this dependency in bundle B pom and add the following under plugins ---> configuration section.
This should work.
if you use the standard AEM project setup (maybe using the respective maven archetype), you should have all custom code in a single bundle. In that case you don't need to change the POM to reference your own service. If you use multiple bundles, you need to create the dependencies in the POM (as you would reference product services).