【问题标题】:Maven download Eclipse artifacts via specific mirrorMaven 通过特定镜像下载 Eclipse 工件
【发布时间】: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 存储库,我需要使用哪种方法?上面的方法是正确的还是我需要使用其他方法?

【问题讨论】:

    标签: eclipse maven nexus


    【解决方案1】:

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

    【讨论】:

    • 是的,它会的。所以这个网址可以添加到您的白名单中
    • 谢谢克里斯蒂安我会试试的。但是如果我需要通过 Nexus P2 repo,我上面的想法是否正确?或者我需要使用什么方法?
    • 如果你用 Nexus 镜像 p2 的东西,你应该使用你的 nexus 的 url
    • 所以,我需要在 pom.xml 中指定真正的存储库(download.eclipse.org),然后在 settings.xml 中指定 ,它将转到 Nexus P2 存储库(它将具有白名单镜像的 url ) ?
    • 为什么不直接使用nexus url?
    猜你喜欢
    • 1970-01-01
    • 2015-06-06
    • 1970-01-01
    • 2013-03-27
    • 2013-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-04
    相关资源
    最近更新 更多