Adobe AEM-包括带有依赖项的第三方罐子(Target SDK)

发布于 2025-02-05 03:09:33 字数 1215 浏览 3 评论 0原文

我们有一个由几个子项目组成的Maven项目。这些项目被部署为AEM实例。我试图将Adobe的Target SDK包括在某些捆绑包中。

像往常一样,我将目标SDK依赖性添加到我的pom.xml中,并将其导入到我们的客户服务类之一中。当我发布捆绑包时,我会在Web控制台上遇到一个错误:

com.adobe.target.delivery.v1.model -- Cannot be resolved
com.adobe.target.edge.client.model -- Cannot be resolved

为了解决上述问题,我将以下内容添加到maven-bundle-plugin配置:

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<exportScr>true</exportScr>
<instructions>
<Embed-Dependency>target-java-sdk;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>

但是,这会产生另一个错误对于目标SDK的依赖项:


com.adobe.experiencecloud.ecid.visitor -- Cannot be resolved
io.github.jamsesso.jsonlogic -- Cannot be resolved
kong.unirest -- Cannot be resolved

因此,我将适当的ID添加到上述&lt; embedDependenty&gt;配置。这修复了这些错误,但导致了基于这些依赖关系的依赖性的更多错误。

必须明确定义Maven插件配置中的依赖关系链显然远非理想。 Adobe似乎没有将SDK作为OSGI捆绑包。处理这种情况的正确方法是什么?我已经进行了研究,但是许多文章过时了,我找不到依赖其他罐子的罐子本身的好解决方案。

谢谢!

We have a maven project that is composed of several subprojects. These projects are deployed as bundles to an AEM instance. I am attempting to include Adobe's Target SDK into some of the bundles.

As usual, I added the Target SDK dependency to my pom.xml and imported it into one of our customer service classes. When I publish the bundle, I get an error on the Web Console:

com.adobe.target.delivery.v1.model -- Cannot be resolved
com.adobe.target.edge.client.model -- Cannot be resolved

In an effort to resolve the above, I added the following to the maven-bundle-plugin configuration:

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<exportScr>true</exportScr>
<instructions>
<Embed-Dependency>target-java-sdk;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>

However, this creates another error due to the dependencies of the Target SDK:


com.adobe.experiencecloud.ecid.visitor -- Cannot be resolved
io.github.jamsesso.jsonlogic -- Cannot be resolved
kong.unirest -- Cannot be resolved

So, I added the appropriate IDs to the above <EmbedDependency> configuration. This fixed those errors but resulted in more errors based, presumably, on the dependencies of those dependencies.

Having to explicitly define a chain of dependencies in the maven plugin config is obviously far from ideal. Adobe does not seem to offer the SDK as an OSGI bundle. What is the proper way to handle such a situation? I have done research, but many articles were quite dated, and I could not find a good solution for JARs themselves that depend on other JARs.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文