AEM Import and Export Bundle | Community
Skip to main content
June 2, 2020
Solved

AEM Import and Export Bundle

  • June 2, 2020
  • 3 replies
  • 8577 views

Hi,

Can someone explain to me what changes need to be made in a maven project so that we can import and export bundles.

Let's say I have a bundle - com.abc

I want to use some classes of the abc bundle in a different bundle - com.pqr

So I will need to export the com.abc bundle (maybe by modifying the pom file) and also import the bundle in com.pqr (by importing the abc bundle in pom file).

What exactly are the changes I need to make to the pom file in order to do this? I see that there is option to add dependency in the file but also to import a package so I am really confused. Some help here on what to do in the pom file would be very much appreciated.
Thanks.

 

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

3 replies

ArpitVarshney
Community Advisor
Community Advisor
June 2, 2020

Hi @abinav_98 

 

You need to understand the concept of the Bundle Resolution Rule in OSGi.This is very well explained in this link.

https://blog.christianposta.com/osgi/understanding-how-osgi-bundles-get-resolved-part-i/

 

Regards,

Arpit Varshney

abinav_98Author
June 2, 2020
Thank you for sending the link. Will read it.
Adobe Employee
June 3, 2020

Your bundle should be exporting the class which can be consumed by other bundles. if you use the @1790552 annotation, it will expose your class as a OSGI service