Unable to resolve recaptcha enterprise bundle
I'm trying to import the following packages in my Captcha Service:
import com.google.cloud.recaptchaenterprise.v1.RecaptchaEnterpriseServiceClient;
import com.google.recaptchaenterprise.v1.Assessment;
import com.google.recaptchaenterprise.v1.CreateAssessmentRequest;
import com.google.recaptchaenterprise.v1.Event;
import com.google.recaptchaenterprise.v1.ProjectName;
Maven build is working fine. Here's my POM setup:
(parent pom.xml)
<build>
<plugins>
......
<plugin>
<!-- Builds the dependency as OSGi bundle -->
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>*;resolution:=optional</Import-Package>
<Export-Package>
com.google.recaptchaenterprise.v1.*,
com.google.auth.*,
com.google.api.gax.*,
com.google.cloud.recaptchaenterprise.v1.*
</Export-Package>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
<plugin>
<!-- Installs the build OSGi bundle into specified AEM instance's felix console -->
<groupId>org.apache.sling</groupId>
<artifactId>sling-maven-plugin</artifactId>
<executions>
<execution>
<id>install-bundle</id>
<goals>
<goal>install</goal>
</goals>
<configuration>
<slingUrl>http://${aem.host}:${aem.port}/system/console</slingUrl>
<refreshPackages>true</refreshPackages>
</configuration>
</execution>
</executions>
</plugin>
......
</plugins>
</build>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-recaptchaenterprise</artifactId>
<version>3.18.0</version>
</dependency>
(core/pom.xml)
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-recaptchaenterprise</artifactId>
</dependency>
However, in my AEM console, I'm still unable to resolve the bundles:
com.google.cloud.recaptchaenterprise.v1 -- Cannot be resolved
com.google.common.collect,version=[15.0,16) from com.adobe.granite.osgi.wrapper.guava (118)
com.google.common.reflect,version=[15.0,16) from com.adobe.granite.osgi.wrapper.guava (118)
com.google.gson,version=[2.8,3) from com.google.gson (499)
com.google.gson.reflect,version=[2.8,3) from com.google.gson (499)
com.google.recaptchaenterprise.v1 -- Cannot be resolved
When I check the logs, I'm getting these errors:
12.09.2024 07:16:47.459 *ERROR* [FelixLogListener] Events.Framework.project-www.core FrameworkEvent ERROR (org.apache.felix.log.LogException: org.osgi.framework.BundleException: Unable to resolve project-www.core [606](R 606.248): missing requirement [project-www.core [606](R 606.248)] osgi.wiring.package; (osgi.wiring.package=com.google.cloud.recaptchaenterprise.v1) Unresolved requirements: [[project-www.core [606](R 606.248)] osgi.wiring.package; (osgi.wiring.package=com.google.cloud.recaptchaenterprise.v1)])
org.apache.felix.log.LogException: org.osgi.framework.BundleException: Unable to resolve project-www.core [606](R 606.248): missing requirement [project-www.core [606](R 606.248)] osgi.wiring.package; (osgi.wiring.package=com.google.cloud.recaptchaenterprise.v1) Unresolved requirements: [[project-www.core [606](R 606.248)] osgi.wiring.package; (osgi.wiring.package=com.google.cloud.recaptchaenterprise.v1)]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4398)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2308)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1566)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.base/java.lang.Thread.run(Thread.java:834)
In AEMaaCS:
2024-09-10 02:34:57.644 Analyser errors have been found
2024-09-10 02:34:57.644 The analyser found the following errors for author and publish :
2024-09-10 02:34:57.644 [api-regions-exportsimports] my.co.project:project-www.core:0.0.1-SNAPSHOT: Bundle project-www.core:0.0.1-SNAPSHOT is importing package(s) [com.google.cloud.recaptchaenterprise.v1, com.google.recaptchaenterprise.v1] in start level 20 but no bundle is exporting these for that start level. (my.co.project:project-www.ui.apps:0.0.1-SNAPSHOT)

