How to add external jars in to the OSGI bundle? | Community
Skip to main content
viren_pushpanay
Level 2
October 16, 2015
Solved

How to add external jars in to the OSGI bundle?

  • October 16, 2015
  • 3 replies
  • 5865 views

Hello,

I am planning on using Jackson to process JSON. How can I include Jackson libraries in to the OSGI bundle? I am using IntelliJ. Adding the Jackson library as a Maven dependency does not work.

Thank you.

Cheers,

Viren.

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 Ojjis

Hi Viren.
I've explained something about this in this thread : http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__uatx-i_need_to_writeacu.html

There I've included the jar as a dependency and then exported the classes of interest in the export packages section in the pom. I hope this will help you :)

/Johan

3 replies

October 16, 2015

First convert those jars in to bundles and add them as dependencies. If you are using eclipse you can use Plug-in Development >>>>>> Plugin Project. After creating bundles deploy them as seperate bundles in your felix. At compile time you can refer them by using system path in your dependencies.

Ojjis
OjjisAccepted solution
Level 7
October 16, 2015

Hi Viren.
I've explained something about this in this thread : http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__uatx-i_need_to_writeacu.html

There I've included the jar as a dependency and then exported the classes of interest in the export packages section in the pom. I hope this will help you :)

/Johan

smacdonald2008
Level 10
October 16, 2015

We have many community articles that cover this topic and walk you through how to do this. See this one.

http://scottsdigitalcommunity.blogspot.ca/2013/06/posting-form-data-to-adobe-cq-using.html

IN this article -- there was a dependency on a JSON Java library. Therefore we had to get the JSON JAR into a bundle and deployed to AEM. In this article - this is explained here (step by step using the Eclipse plug-in):

[img]Abundle.png[/img]

This provides step by step for maruthid's response above (which is correct). Ojjis provides another correct answer as well. 

Hope this helps