Maven通过特定的镜像下载Eclipse工件

时间:2018-07-25 18:21:34

标签: eclipse maven nexus

对不起,没有足够的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存储库,该使用哪种方法?上面的方法是正确的还是我需要使用其他方式?

1 个答案:

答案 0 :(得分:0)

您可以使用-Dtycho.disableP2Mirrors=true或禁用镜像 或通过settings.xml http://wiki.eclipse.org/Tycho/FAQ#How_do_I_disable_P2_mirrors.3F