Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Include custom OSGI bundle in AEM Project

akatsuki07
Level 2
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
markus_bulla_adobe
Correct answer by
Employee
Employee

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
shelly-goel
Community Advisor
Community 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.

markus_bulla_adobe
Correct answer by
Employee
Employee

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

akatsuki07
Level 2
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?
markus_bulla_adobe
Employee
Employee

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!