1

情况

  • 我有一个使用 Tycho 使用 maven 构建的 Eclipse RCP 应用程序。
  • 该应用程序是从命令行使用简单的mvn install.
  • 在构建期间,从 Nexus 代理存储库检索 p2 依赖项,镜像 Eclipse 的开普勒存储库。

问题

直到不久前,这个构建运行良好。所有依赖项都已正确解析和获取。

现在 Tycho OSGi 依赖解析器开始为版本 X 的平台插件添加依赖,而该插件的 Kepler 版本是版本 Y。

例如:

  • 开普勒版本:org.eclipse.emf.ecore.xmi_2.9.0.v20130528-0742
  • OSGi 依赖:org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309

生成的 Maven 输出为:

[INFO] Scanning for projects...
[INFO] Computing target platform for MavenProject: com.mycompany.products.myproduct:myproduct.gui.build:1.8.17-SNAPSHOT @ /home/myusername/programming/myproduct/gui/product-gui-1.8.x/gui/myproduct.gui.build/pom.xml
[INFO] Adding repository http://nexus.buildnet.mycompany.com/nexus/content/repositories/myproduct-releases/.meta/p2
[INFO] Adding repository http://nexus.buildnet.mycompany.com/nexus/content/repositories/myproduct-snapshots/.meta/p2
[INFO] Adding repository http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler
[INFO] Resolving dependencies of MavenProject: com.mycompany.products.myproduct:myproduct.gui.build:1.8.17-SNAPSHOT @ /home/myusername/programming/myproduct/gui/product-gui-1.8.x/gui/myproduct.gui.build/pom.xml
[INFO] Downloading org.eclipse.core.runtime
[INFO] Fetching org.eclipse.core.runtime_3.9.0.v20130326-1255.jar.pack.gz from http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/ (0B of 31.5kB at 0B/s)
[INFO] Fetching org.eclipse.core.runtime_3.9.0.v20130326-1255.jar.pack.gz from http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/ (4kB of 31.5kB at 0B/s)
[INFO] 1 operation remaining.
[INFO] Downloading org.eclipse.emf.ecore.xmi
[INFO] Downloading org.eclipse.ui.workbench
[INFO] Downloading org.eclipse.jface
...
<many are downloaded correctly>
...
[INFO] Downloading org.eclipse.rcp_root
[INFO] Downloading org.eclipse.swt.gtk.linux.x86
[ERROR] Internal error: java.lang.RuntimeException: "Messages while reading artifacts from child repositories": ["Problems while reading artifacts from http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler": ["Artifact not found: http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309.jar.", "Artifact not found: http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/org.eclipse.ui.workbench_3.105.1.v20130821-1411.jar.", "Artifact not found: http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/org.eclipse.jface_3.9.1.v20130725-1141.jar.", "Artifact not found: http://nexus.buildnet.mycompany.com/nexus/content/repositories/eclipse-kepler/plugins/org.eclipse.core.resources_3.8.101.v20130717-0806.jar.",............]] -> [Help 1]

问题

第谷如何选择依赖版本?我在这里读到,我只需将 Kepler 存储库添加到我的项目中,即可将 Tycho 与 Kepler 目标平台相匹配。

第谷如何选择似乎没有存储在 Kepler 存储库中的版本。Tycho 依赖解析器在哪里找到这些非 Kepler 版本?

4

1 回答 1

2

正如 greg-449 所指出的,Kepler Service Release 1 最近被添加到 Kepler p2 存储库http://download.eclipse.org/releases/kepler/中。所以新版本的 org.eclipse.emf.ecore.xmi 等实际上是 Kepler 存储库的一部分。

Tycho 无法下载新版本工件的事实似乎是您的 Nexus p2 存储库代理设置中的一个问题。工件 org.eclipse.emf.ecore.xmi_2.9.1.v20130827-0309.jar 在原始存储库中可用(逻辑上根据 p2 index 和physical)。根据我的经验,Nexus p2 存储库代理不能可靠地与复合 p2 存储库(如 Kepler)一起使用。

可以选择仅使用 Kepler 的 6 月发布版本:只需将 Kepler p2 存储库 URL 替换为http://download.eclipse.org/releases/kepler/201306260900/即可。这个 p2 存储库是构成完整 Kepler 存储库的子存储库之一。(要查看 Kepler 存储库中的所有子存储库,请查看存储库的 compositeContent.jar。)

于 2013-10-14T08:02:40.570 回答