【问题标题】:How to add aem Uber jar dependency in maven build如何在 Maven 构建中添加 aem Uber jar 依赖项
【发布时间】:2017-03-11 04:53:15
【问题描述】:

我已经使用了如下所示的maven archetype10,并创建了项目结构,一切都很好。

mvn archetype:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=10 -DarchetypeRepository=https://repo.adobe.com/nexus/content/groups/public/

现在我想添加 aem uber-jar 依赖项并分别在项目 pom.xml 和核心模块 pom.xml 中添加以下依赖项标签,并且我的存储库标签与 https://repo.adobe.com/ 相同

       <dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>uber-jar</artifactId>
            <version>6.2.0</version>
            <scope>provided</scope>
        </dependency>

在编译时添加上述依赖标记后,出现以下错误。

[错误] 无法在项目 aemexample.core 上执行目标:无法 解决项目的依赖关系 com.krishh.example:aemexample.core:bundle:0.1:无法传输 工件 com.adobe.aem:uber-jar:jar:6.2.0 from/to adobe-public-releases (http://repo.adobe.com/nexus/content/groups/public): 主机名 证书不匹配:&lt;repo.adobe.com&gt; != &lt;devedge.day.com&gt;&lt;devedge.day.com&gt; -> [帮助1]

是否缺少任何添加额外的依赖项以成功编译和运行。

【问题讨论】:

标签: maven maven-3 maven-plugin aem uberjar


【解决方案1】:

您的依赖项中似乎缺少分类器。尝试为 AEM API 添加一个,如 suggested in the documentation。这应该有助于 Maven 在存储库中找到必要的 JAR:

<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <version>6.2.0</version>
    <classifier>apis</classifier>
    <scope>provided</scope>
</dependency>

如果这没有帮助,您还应该查看证书警告。查看this question 的答案以获取有关该主题的更多信息。

TL;DR - 可能的原因可能是:

  • 使用不符合存储库所使用证书的 HTTP 库的旧 Maven 版本 - 尝试升级 Maven
  • 服务器使用了错误的证书
  • 您与存储库之间的潜在网络配置问题
  • 伪装成 Nexus 的一方实际尝试让您下载恶意文件

【讨论】:

  • 是添加仍然错误。 [ERROR] :Unresolveable build extension: Plugin com.day.jcr.vault:content-package-maven-plugin:0.0.23 or one of its dependencies could not be resolved: Failed to read artifact descriptor for com.day.jcr.vault:content-package-maven-plugin:jar:0.0.23: Could not transfer artifact com.day.jcr.vault:content-package-maven-plugin:pom:0.0.23 from/to adobe (https://repo.adobe.com/nexus/content/groups/public/): hostname in certificate didn't match: &lt;repo.adobe.com&gt; != &lt;devedge.day.com&gt; OR &lt;devedge.day.com&gt;[ERROR] Unknown packaging: content-package @ line 39, column 16
  • @krish 这是另一个人工制品的问题。奇怪的是,我刚刚基于相同的原型构建了一个项目,它使用的是content-package-maven-plugin OOTB 的版本0.0.24。你能在你的 pom 中显示这种依赖关系吗?
  • 这是我的插件版本` com.day.jcr.vaultcontent-package-maven-plugin0.0. 23truetrue${crx.username}${crx.password}`
  • 将其更改为 0.0.24 后编译问题已解决。但最终又遇到了 uber jar 问题Failed to collect dependencies at com.adobe.aem:uber-jar:jar:apis:6.2.0: Failed to read artifact descriptor for com.adobe.aem:uber-jar:jar:apis:6.2.0: Could not transfer artifact com.adobe.aem:uber-jar:pom:6.2.0 from/to adobe (https://repo.adobe.com/nexus/content/groups/public/): hostname in certificate didn't match: &lt;repo.adobe.com&gt; != &lt;devedge.day.com&gt; OR &lt;devedge.day.com&gt; -&gt; [Help 1]
  • 我无法重现这些问题。它们可能与您的 DNS 设置有关。当我下载人工制品时,我可以看到证书正在使用域repo.adobe.com。您似乎使用不同的域访问相同的内容。在您的情况下,不确定devedge.day.come 来自哪里。 AFAIK,该网站很久以前就被删除了。
猜你喜欢
  • 1970-01-01
  • 2020-02-19
  • 1970-01-01
  • 1970-01-01
  • 2016-04-19
  • 2017-01-01
  • 2018-01-20
  • 2019-09-03
  • 1970-01-01
相关资源
最近更新 更多