【发布时间】:2018-07-25 18:21:34
【问题描述】:
抱歉没有足够的maven经验所以问题:
我们有 Jenkins 和 Nexus 服务器。我们需要制作使用 Eclipse 的 Maven 构建。如您所知,当我们需要从 http://www.eclipse.org 下载内容时,它会重定向到其中一个镜像:http://www.eclipse.org/downloads/download.php?format=xml
在 Jenkins 服务器上是防火墙,只有一个镜像被列入白名单。所以我们只需要使用 1 个特定的镜像。
目前它失败了,因为它重定向到未列入白名单的镜像(看起来它是随机选择的):
[DEBUG] Resolving target definition content...
[INFO] Fetching p2.index from http://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.13.0/
[INFO] Fetching p2.index from http://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.13.0/
[INFO] Adding repository http://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.13.0
[INFO] Fetching p2.index from http://download.eclipse.org/releases/oxygen/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/oxygen/
[INFO] Adding repository http://download.eclipse.org/releases/oxygen
[INFO] Fetching p2.index from http://download.eclipse.org/technology/epp/packages/oxygen/
[INFO] Fetching p2.index from http://download.eclipse.org/technology/epp/packages/oxygen/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/oxygen/201804111000/
[INFO] Fetching p2.index from http://download.eclipse.org/releases/oxygen/201804111000/
!ENTRY org.eclipse.equinox.p2.core 4 0 2018-07-25 17:28:40.029
!MESSAGE Provisioning exception
!STACK 1
org.eclipse.equinox.p2.core.ProvisionException: Artifact not found: http://download.eclipse.org/releases/oxygen/201804111000/content.xml.xz.
at org.eclipse.equinox.internal.p2.repository.CacheManager.updateCache(CacheManager.java:428)
我们怎么做?
我在想,在pom.xml中指定:
<repository>
<id>eclipse-oxygen</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/oxygen</url>
</repository>
在 settings.xml 中:
<mirror>
<id>eclipse-oxygen-mirror</id>
<name>Eclipse stuff</name>
<url>url of p2 nexus repo</url>
<layout>p2</layout>
<mirrorOf>eclipse-oxygen</mirrorOf>
- 已配置 Nexus P2 存储库,其中指定了列入白名单的镜像。
你能告诉它正确的方法吗? 我应该以同样的方式识别所有日食功能吗? (例如氧气、月神、朱诺、靛蓝等) 喜欢:
<repository>
<id>eclipse-oxygen</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/luna</url>
</repository>
<repository>
<id>eclipse-oxygen</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/juno</url>
</repository>
等等?
感谢 Christian 选择禁用镜像并直接从 http://download.eclipse.org 下载。
但是,如果我需要通过 Nexus P2 存储库,我需要使用哪种方法?上面的方法是正确的还是我需要使用其他方法?
【问题讨论】: