Expand my Community achievements bar.

SOLVED

Import third party dependency

Avatar

Level 1

Hello all,

I'm trying to import third party dependency in my project , so i added below dependency in core pom.xml

        <dependency>
            <groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
            <artifactId>owasp-java-html-sanitizer</artifactId>
            <version>20240325.1</version>
            <scope>provided</scope>
        </dependency>
 
but when I build the build is getting failed with the below error
[ERROR] [api-regions-exportsimports] com.demo:demo.core:1.0.0-SNAPSHOT: Bundle demo.core:1.0.0-SNAPSHOT is importing package(s) org.owasp.html in start level 20 but no bundle is exporting these for that start level. (com.demo:demo.all:1.0.0-SNAPSHOT)
How to resolve this one to import the dependency?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
6 Replies

Avatar

Level 4

Hi @KeerthiKu 

 

The error you posted looks like the dependent bundle is failed to activate -

 

Did you try to use bnd-maven-plugin to embed third party dependency ?

 

Here you can find more details -

 

https://medium.com/@bsaravanaprakash/how-to-fix-bundle-is-importing-packages-xxx-in-start-level-20-b...

 

Hope this helps 

 

Prathyusha

Avatar

Level 6

Hi,

It's not working in that way, tried that way.

Is there any other way to import?

 

Avatar

Correct answer by
Community Advisor

@Keerthi0555 

Please follow the steps mentioned in below article to fix this issue

Embedding Third party dependency/OSGi bundle in AEM application hosted in AEMasCS

Avatar

Level 5

Hi @KeerthiKu 


First of all, is your issue on AEMaaCS version ?

 

Now, just assuming you are using AEMaaCS, you have couple of options:


Hope this helps !

Avatar

Administrator

@KeerthiKu Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni