Included dependency jar is not resolving in bundle | Community
Skip to main content
GK-007
Level 9
October 16, 2015
Solved

Included dependency jar is not resolving in bundle

  • October 16, 2015
  • 4 replies
  • 2455 views

Hi All,,

In one of my sling servlet we are parsing a xml for this we are using dom4j.

To compile these classes i have included below Maven dependency.

<dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.3</version>
        </dependency>

When i create bundle and installing through Maven bulid script this classes in this jar are not reflecting.

Do i need to make any changes build script to automatically deploy into CQ server?

Thanks,

Kishore

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 smacdonald2008

Use Eclipse plug-in project to wrap the JAR into an OSGi bundle and deploy the bundle to AEM. See this article to learn how to wrap a JAR into an OSGi using Eclipse plug-in project: 

https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

As an example - notice how we wrap the simple JSON JAR into an OSGi bundle. 

4 replies

joerghoh
Adobe Employee
Adobe Employee
October 16, 2015

You need either to embed this dependency into your jar or deploy an osgi-version of that jar into AEM. Google says, that Apache servicemix provides an OSGI version of dom4j, so you can deploy it together with your bundles into AEM.

kind regards,
Jörg

GK-007
GK-007Author
Level 9
October 16, 2015

Jörg Hoh wrote...

You need either to embed this dependency into your jar or deploy an osgi-version of that jar into AEM. Google says, that Apache servicemix provides an OSGI version of dom4j, so you can deploy it together with your bundles into AEM.

kind regards,
Jörg

 

Thanks Jorg,

Could you please explain in detail, and how to do this?

edubey
Level 10
October 16, 2015

Please refer to the following links for more details on how you can achieve this:

How to embed a jar: https://github.com/cytoscape/cytoscape-app-samples/blob/master/sample-embed-dependencies/pom.xml

Few basic concepts: http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html

Let me know if you need anything else.

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

Use Eclipse plug-in project to wrap the JAR into an OSGi bundle and deploy the bundle to AEM. See this article to learn how to wrap a JAR into an OSGi using Eclipse plug-in project: 

https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

As an example - notice how we wrap the simple JSON JAR into an OSGi bundle.