Include custom OSGI bundle in AEM Project | Community
Skip to main content
July 27, 2021
Solved

Include custom OSGI bundle in AEM Project

  • July 27, 2021
  • 4 replies
  • 3558 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MarkusBullaAdobe

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!

4 replies

shelly-goel
Adobe Employee
Adobe Employee
July 28, 2021

@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.

Adobe Employee
July 28, 2021
MarkusBullaAdobe
Adobe Employee
MarkusBullaAdobeAdobe EmployeeAccepted solution
Adobe Employee
July 28, 2021

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!

August 6, 2021
@markusbullaadobe 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?
RajaShankar
Community Advisor
Community Advisor
July 28, 2021

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