首页 > 解决方案 > 无法将 Google Cloud Datastore 与 AEM 6.5 连接:Bundle 已解决依赖项

问题描述

我需要从 AEM 连接谷歌云数据存储。我在 main pom 和 core pom 中添加了依赖项。

主 POM

      <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>libraries-bom</artifactId>
            <version>16.4.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>de here

核心 POM

 <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>google-cloud-datastore</artifactId>
    </dependency>

当我部署时,我的包处于 insatlled 状态并出现以下错误

com.google.auth -- Cannot be resolved
com.google.auth.oauth2 -- Cannot be resolved
com.google.cloud -- Cannot be resolved
com.google.cloud.datastore -- Cannot be resolved

标签: mavengoogle-cloud-platformaem

解决方案


尝试将这些库添加到 POM 中的嵌入依赖项中。还要检查您的库是否在生成的 .jar 文件中。

 <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <!-- <Embed-Dependency> artifactId1, artifactId2;inline=true </Embed-Dependency> -->
                    <Export-Package>we.retail.core.model*</Export-Package>
                    <Private-Package>we.retail.core*</Private-Package> 
                    <Sling-Model-Packages>
                        we.retail.core.model
                    </Sling-Model-Packages>
                </instructions>
            </configuration>
        </plugin>

在嵌入中,您可以尝试以下操作:google-cloud-datastore

还要注意您使用的导入类型。 在此处输入图像描述

链接到 Maven

希望你能找到答案


推荐阅读