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

Adding third party dependencies in maven

Avatar

Avatar
Validate 1
Level 1
kgiribabu
Level 1

Likes

0 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
kgiribabu
Level 1

Likes

0 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
kgiribabu
Level 1

10-06-2021

I am using Microsoft Graph api and would like to know how to add that dependency in maven.  I have tried with below entries but not working as expected. 

 

Added below entry in dependencies

<dependency>
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph</artifactId>
<version>3.2.0</version>
</dependency>

 

And added embed dependency entry in profiles as below...

<Embed-Dependency>microsoft-graph</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>

 

No compilation issues. It's throwing dependency errors when I deploy it to aem6.5. Looks like it's not resolving the recursive dependencies. 

 

Any help on this is greatly appreciated..

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Level 5
Bhuwan_B
Level 5

Likes

100 likes

Total Posts

97 posts

Correct Reply

35 solutions
Top badges earned
Boost 100
Give Back 3
Affirm 25
Establish
Give Back
View profile

Avatar
Boost 100
Level 5
Bhuwan_B
Level 5

Likes

100 likes

Total Posts

97 posts

Correct Reply

35 solutions
Top badges earned
Boost 100
Give Back 3
Affirm 25
Establish
Give Back
View profile
Bhuwan_B
Level 5

10-06-2021

@kgiribabu Please follow the steps mentioned in below community article :

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-bundle-third-party-...

1. Add dependency to the pom.xml

<dependency>

<groupId>com.thirdparty</groupId>

<artifactId>my-bundle</artifactId>

<version>1.0.0</version>

<scope>system</scope>

<systemPath>${project.basedir}/../repo/thirdparty.jar</systemPath>

</dependency>

if you have the bundle in your system , you can simply give the path to that bundle using the scope 'system'. Here, the folder 'repo' is besides the bundle folder in the project structure.

 

2. In your maven bundle plugin configuration in pom.xml, add the jar to the embed-dependency option like that:

<plugin>

<groupId>org.apache.felix</groupId>

<artifactId>maven-bundle-plugin</artifactId>

<version>2.3.7</version>

<configuration>

<instructions>

<Embed-Dependency>*;scope=system</Embed-Dependency>

</instructions>

</configuration>

</plugin>

 

3. Build the maven project

 

Answers (3)

Answers (3)

Avatar

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

511 likes

Total Posts

647 posts

Correct Reply

213 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile

Avatar
Boost 500
MVP
Vijayalakshmi_S
MVP

Likes

511 likes

Total Posts

647 posts

Correct Reply

213 solutions
Top badges earned
Boost 500
Give Back 50
Give Back 5
Ignite 10
Ignite 5
View profile
Vijayalakshmi_S
MVP

11-06-2021

Hi @kgiribabu,

Only correction needed in <Embed-Dependency> entry.

It has explicit mention of artifactId "microsoft-graph" alone to be included/embedded as part of core bundle. 

 

Please use "*" which includes/embed all of its transitive(compile and/or runtime) dependencies along with core bundle. 

<Embed-Dependency>*</Embed-Dependency> // This will include all maven dependencies as available in parent pom.xml/core pom within <dependencies> entry.

 

If you still face issues in few dependencies resolving/ NoClassDefFound Error at the time of execution/testing the functionality even when the bundle is active, please update this thread with respective dependency details. 

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

559 likes

Total Posts

676 posts

Correct Reply

194 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

559 likes

Total Posts

676 posts

Correct Reply

194 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

10-06-2021

Hi @kgiribabu 

 

Everything looks good here. Only one item is missing which you need to add in your ui.apps POM.xml file. This is just to install the 3rd party jar on your AEM instance.

Please embedd the external JAR at the same location where you have embedded your project specific jar file i..e under "content-package-maven-plugin".

 

<embedded>
      <groupId>com.microsoft.graph</groupId>
      <artifactId>microsoft-graph</artifactId>
      <target>/apps/yourprojectname/install</target>
   </embedded>

 

If you do not want to follow the above process, you can manually install the JAR on OSGi at "http://localhost:4502/system/console/bundles" as well.

 

Thanks!

 

Avatar

Avatar
Boost 10
Level 2
ibishika
Level 2

Likes

17 likes

Total Posts

17 posts

Correct Reply

1 solution
Top badges earned
Boost 10
Boost 5
Give Back
Applaud 5
Boost 3
View profile

Avatar
Boost 10
Level 2
ibishika
Level 2

Likes

17 likes

Total Posts

17 posts

Correct Reply

1 solution
Top badges earned
Boost 10
Boost 5
Give Back
Applaud 5
Boost 3
View profile
ibishika
Level 2

10-06-2021