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

How to Integrate Alibaba captcha in AEMaacs

Avatar

Level 3

I am following the below document for integration of Alibaba captcha.. 

 

https://www.alibabacloud.com/help/en/captcha/captcha2-0/user-guide/add-a-web-or-html5-client-to-alib...

 

 

But when I try to add the maven dependency for aliyun, I am getting an error in project.all module.

My dependency is:


<dependency>
<groupId>com.aliyun</groupId>
<artifactId>captcha20230305</artifactId>
<version>1.1.2</version>
<scope>provided</scope>
</dependency>


The error I got was:


[ERROR] The analyser found the following errors for author and publish :
[ERROR] [api-regions-exportsimports] com.abc:aem-abc-project.core:4.1.0: Bundle aem-abc-project.core:4.1.0 is importing package(s) [com.aliyun.teaopenapi.models, com.aliyun.captcha20230305.models, com.aliyun.captcha20230305] in start level 20 but no bundle is exporting these for that start level. (com.abc:aem-abc-project.all:4.1.0)

 

 

I resolve the issue I tried the below reference:
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/getting-error-while-buildi...
But the issue is still the same.

Any leads?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

 

This explains how to solve your issue: https://myaemlearnings.blogspot.com/2021/08/embedding-third-party-dependencyosgi.html 

Keep in mind that you should remove the <scope>provided</scope> tag once you embed the dependency as part of your bundle.

 

Hope this helps



Esteban Bustamante

View solution in original post

3 Replies

Avatar

Community Advisor

Hi @SRC_AEM_DEV ,  Can you please check if the packages from the aliyun dependencies are exported in the Export-Package section of your bnd.bnd file or the maven-bundle-plugin configuration.

 

After adding the dependency you will need to add something like the below in your pom for maven-bundle-plugin

 

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.5.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Export-Package>
com.aliyun.captcha20230305.*
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>

Avatar

Correct answer by
Community Advisor

Hi,

 

This explains how to solve your issue: https://myaemlearnings.blogspot.com/2021/08/embedding-third-party-dependencyosgi.html 

Keep in mind that you should remove the <scope>provided</scope> tag once you embed the dependency as part of your bundle.

 

Hope this helps



Esteban Bustamante

Avatar

Administrator

@SRC_AEM_DEV Did you find the suggestions from users 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