Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Include custom OSGI bundle in AEM Project

Avatar

Level 2

Hello all,

 

I have a custom AEM project which I've built some services/servlet and will only be installing the core module (lets say osgi bundle a) on to AEM.

 

Now I want to add this bundle a into another AEM Project which will consume bundle a's services & servlets.

 

How can I go about adding my custom bundle to my custom AEM Project while resolving dependencies. I would also like to know what to add to my pom.xml's if possible.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @akatsuki07!

There are multiple approaches to achieve this:

  • You could integrate/join the two projects into a single SCM (probably GIT?) repository if that's feasible.
  • You could build your bundle and deploy it to a central software repository, such as Artifactory, Nexus or similar as mentioned by @shelly-goel. Your other project would then reference it as a dependency (the same way you are referencing other, 3rd party dependencies) and you would need to update your pom.xml file to embed it.
  • You could also opt for a loose coupling and deploy the two artifacts separately. The bundle would still need to be added as a dependency (provided in this case) and resolvable through e. g. a software repository (again: Artifactory, Nexus or similar) but you would decouple release and deployment cycles.

Hope that helps!

View solution in original post

6 Replies

Avatar

Employee Advisor

@akatsuki07  You would require a nexus repository to export the bundle into that and then include that nexus repository into your parent pom.xml & use <embed-dependency> to include this bundle.

Avatar

Correct answer by
Employee Advisor

Hi @akatsuki07!

There are multiple approaches to achieve this:

  • You could integrate/join the two projects into a single SCM (probably GIT?) repository if that's feasible.
  • You could build your bundle and deploy it to a central software repository, such as Artifactory, Nexus or similar as mentioned by @shelly-goel. Your other project would then reference it as a dependency (the same way you are referencing other, 3rd party dependencies) and you would need to update your pom.xml file to embed it.
  • You could also opt for a loose coupling and deploy the two artifacts separately. The bundle would still need to be added as a dependency (provided in this case) and resolvable through e. g. a software repository (again: Artifactory, Nexus or similar) but you would decouple release and deployment cycles.

Hope that helps!

Avatar

Level 2
@markus_bulla_adobe Hey I'd like to do the third approach but I don't see the difference between the second approach if you sitll have to add it as a dependency? Can you elaborate a bit more on this please?

Avatar

Employee Advisor

Hi @akatsuki07!

Option 2 will embed the bundle into package, resulting in a single deployment package that deploys both parts together.

Option 3 will tell the bundle that there is a dependency, but the other bundle has to be deployed separately. So you will have to separate deployments.

Hope that clarifies it at bit!

Avatar

Community Advisor

Hi @akatsuki07  My two cents you can also refer to this blog for additional info

http://www.wemblog.com/2014/01/how-to-include-cq-package-from-other.html

 

Regards,

Rajashankar.R