Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

adding thrid party jar into aem through embed dependency in maven bundle plugin

Avatar

Level 7

Hi Folk ,

 

adding thrid party jar into aem through embed dependency in maven bundle plugin.

 

The problem is suppose i need opencsv then i went and updated<embed-dependecny> openscv  <embed dependency >> inside <maven-bundle-plugin> and build the bundle and uploaded the bundle in system/console 

first issue : I found my bundle is still not active . It is in installed stage and I can see some red unresolved dependency which is suppose beanutils or some other depency which is introduced after i definded opencsv ..

 

 

 

Now I agin went and changed the pom.xml and added <embed-dependecny> openscv , beansutil <embed dependency >

now again build and deployed the bundle now everthing worked and done . 

 

Now this was simple case .

 

But similar case for solrj i tried or you can consider any other 3rd party dependency which I want to bundled it with my project bundle I will do the same . Adding into embed depency section and --> build--> deploy ..now in other case 

 

everytime i add any dependecy it introduces some 15+ or more new depedency again I started adding the all list of depenecy in <embed-dependecny> section and build it and deploy it that issue is gone but now other new unresolved dependency came . so this become infinite loop and number of list to add as embed depdency increasing .

 

Note : I know that we can create bundle from jar and all but if anyone don't want to go in that way of creating bundle from jar manually by performing some steps in eclipse then what is the way here with embed dependency to do the same ? 

Similar question has been asked 

https://stackoverflow.com/questions/72536366/adobe-aem-including-third-party-jar-with-dependencies-t...

 

@vanegi 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @AdobeID24 
If the jars/bundle are not available in AEM then you have to install it .

 

Please check https://stackoverflow.com/questions/56080054/aem-osgi-3rd-party-dependency-bundle-not-active 



Arun Patidar

View solution in original post

5 Replies

Avatar

Community Advisor

Hi @AdobeID24 

Sorry for the confusion, if the bundle jar already exists in maven repo or adobe repo or your own repo then you can embed from there.



Arun Patidar

Avatar

Level 7

hi @arunpatidar  , Thanks for your reply . Got your point .

 

But my problem is embedding one dependency which i needed introducing other dependencies which causes my bundle to be in installed state . 

Suppose I want this dependency to be added so I embed this with maven-bundle-plugin with embed tag ..so this is getting embeedded with my bundle succcessfullly but when I deploy this bundle my bunlde is in red due to all other dependcy is not met which has been introduced after adding below depenedy . 

<dependency>
    <groupId>org.apache.servicemix.bundles</groupId>
    <artifactId>org.apache.servicemix.bundles.solr-solrj</artifactId>
    <version>8.11.1_1</version>
</dependency>

 

And I can not go and keep on embedding  all the dependency its too many . 

 

 

Avatar

Correct answer by
Community Advisor

Hi @AdobeID24 
If the jars/bundle are not available in AEM then you have to install it .

 

Please check https://stackoverflow.com/questions/56080054/aem-osgi-3rd-party-dependency-bundle-not-active 



Arun Patidar