내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Included dependency jar is not resolving in bundle

Avatar

Level 9

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

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 10

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 답변 개

Avatar

Employee Advisor

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

Avatar

Level 9

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?

Avatar

Level 10

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.

Avatar

정확한 답변 작성자:
Level 10

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.