我正在使用AEM6.2。我已将用户数据设置为clientContextHub。现在我需要将这些clientcontextHub值放入我的组件WCMUsePojo类中。我写的如下:
ContextHub contexthub = getSlingScriptHelper().getService(ContextHub.class);
Resource res = this.getResourceResolver().getResource("/etc/cloudsettings/default/contexthub");
stores = contexthub.findStores(res);
当我部署此代码时,我发现我的捆绑包不活动,因为
com.adobe.granite.contexthub.api,version=[3.0,4) -- Cannot be resolved.
如果在pom.xml中添加了相应的依赖项,则构建将失败,因为adobe存储库http://repo.adobe.com/nexus/content/groups/public/com/adobe/granite中不存在所需的jar文件:
<dependency>
<groupId>com.adobe.granite</groupId>
<artifactId>com.adobe.granite.contexthub.commons</artifactId>
<version>0.0.36</version>
</dependency>