【问题标题】:Eclipse Tycho not able to resolve the correct dependencyEclipse Tycho 无法解决正确的依赖关系
【发布时间】:2013-04-20 04:42:46
【问题描述】:

我正在使用 Eclipse Tycho 来构建我的 RCP 应用程序,其中包含 GMF 依赖项。

我收到以下错误 -

[ERROR] Internal error: java.lang.RuntimeException: Could not download artifacts from any repository
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.emf.core,1.4.1.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.emf.commands.core,1.4.0.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.emf.ui.properties,1.5.0.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.diagram.ui,1.6.0.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.diagram.ui.properties,1.4.2.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.diagram.ui.providers,1.5.0.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.diagram.ui.providers.ide,1.2.0.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.diagram.ui.render,1.6.0.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.diagram.ui.resources.editor,1.4.1.v20120514-1615
[ERROR] osgi.bundle,org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide,1.2.1.v20120514-1615

我在 Manifest.MF 中指定了以下依赖项 -

org.eclipse.gmf.runtime.emf.core;bundle-version="1.4.1",
 org.eclipse.gmf.runtime.emf.commands.core;bundle-version="1.4.0",
 org.eclipse.gmf.runtime.emf.ui.properties;bundle-version="1.5.0",
 org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
 org.eclipse.gmf.runtime.diagram.ui.properties;bundle-version="1.4.2",
 org.eclipse.gmf.runtime.diagram.ui.providers;bundle-version="1.5.0",
 org.eclipse.gmf.runtime.diagram.ui.providers.ide;bundle-version="1.2.0",
 org.eclipse.gmf.runtime.diagram.ui.render;bundle-version="1.6.0",
 org.eclipse.gmf.runtime.lite.svg;bundle-version="1.0.0",
 org.eclipse.gmf.runtime.diagram.ui.resources.editor;bundle-version="1.4.1",
 org.eclipse.gmf.runtime.diagram.ui.resources.editor.ide;bundle-version="1.2.1",

我已将 GMF 包的存储库位置提供为 -

<repository>
  <id>gmf-runtime</id>
  <url>http://download.eclipse.org/modeling/gmp/gmf-runtime/updates/releases</url>
  <layout>p2</layout>
</repository>

P2 存储库包含上述所有 JAR。唯一的区别是,出于某种原因,第谷正在寻找 .v20120514-1615 限定符。但是 P2 存储库具有 .201302191707 限定符。不知道为什么第谷在寻找那个特定的限定词而不是解析到最新版本。

【问题讨论】:

  • 看来.v20120514-1615版本也在你的目标平台上。您配置的其他一些 p2 存储库似乎包含 gmf 可安装单元(请参阅 content.jar/content.xml),但不包含相应的工件。
  • @oberlies :只是想知道是否有任何方法可以跟踪具有该可安装单元的 P2 存储库? maven/tycho 调试标志可能吗?
  • -Dtycho.debug.resolver=true 打印出target platform 中的所有 IU,但 AFAIK 并没有说明内容来自哪个 p2 存储库。不过,请随时为此打开enhancement request

标签: java maven eclipse-plugin tycho


【解决方案1】:

原来的 P2 Repo 似乎已损坏。问题是即使没有引用插件,Tycho 也会尝试索引整个 P2 存储库。为了解决这个问题,我们做了 -

  1. 打开 .product 文件并导出产品
  2. 从导出的产品工件中复制“存储库”文件夹并将其放在共享位置
  3. 在 Maven pom.xml 的标签中,如果是外部存储库,则提供此存储库的位置。未来的所有 Tycho 构建都将使用此存储库

这样,repo 的大小很小,所有的构建问题都得到了解决。

【讨论】:

  • 您的意思是“即使未引用 .jars,Tycho 也会尝试索引整个 P2 存储库”?
  • @PaulVerest :不幸的是,是的。但索引本质上意味着它检查 P2 存储库中的 content.jar 文件并查看是否可以解决所有问题。只要正确设置了 P2 存储库,一切都会正常工作。我发现最好的方法是在我们自己的服务器上镜像存储库(也许有更好的方法)。
猜你喜欢
  • 1970-01-01
  • 2019-12-14
  • 1970-01-01
  • 2016-02-16
  • 2017-02-20
相关资源
最近更新 更多