第谷下载依赖关系,但未能解决 [英] Tycho downloads dependency but fails to resolve it

查看:79
本文介绍了第谷下载依赖关系,但未能解决的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Tycho 0.15.0遇到了一个奇怪的问题.我的 MANIFEST.MF 中有8个依赖项,但是Tycho无法解析其中之一.输出看起来像这样:

I have an odd problem with Tycho 0.15.0. There are 8 dependencies in my MANIFEST.MF but Tycho fails to resolve one of them. The output looks like this:

[INFO] 1 operation remaining.
[INFO] Fetching org.eclipse.xtext.logging_1.2.15.v201206120633.jar (4kB of 10.12kB at 0B/s) from http://my.server.com/p2-3.7.2/plugins/
[INFO] Resolving class path of MavenProject: <...my project ...> @ <...path to my project...>/pom.xml
[ERROR] Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle <...my project...> cannot be resolved
[ERROR] Resolution errors:
[ERROR] Bundle <...my project...> - Missing Constraint: Require-Bundle: org.eclipse.xtext.logging; bundle-version="1.2.15"
[ERROR] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: org.osgi.framework.BundleException: Bundle <...my project...> cannot be resolved
Resolution errors:
Bundle <...my project...> - Missing Constraint: Require-Bundle: org.eclipse.xtext.logging; bundle-version="1.2.15"

我所知道的:

  1. jar org.eclipse.xtext.logging_1.2.15.v201206120633.jar 存在
  2. 罐子没有损坏
  3. Tycho可以从我的p2服务器上下载它(我有〜/.m2/repository/p2/osgi/bundle/org.eclipse.xtext.logging/1.2.15.v201206120633/org.eclipse.xtext.我计算机上的logging-1.2.15.v201206120633.jar )
  4. MANIFEST.MF 看起来正确:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Bundle-Vendor: %providerName
Bundle-Localization: fragment
Fragment-Host: org.apache.log4j;bundle-version="[1.2.15,1.2.16)"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.xtext.logging;singleton:=true
Created-By: 1.5.0_22-b03 (Sun Microsystems Inc.)
Bundle-Version: 1.2.15.v201206120633
Bundle-ManifestVersion: 2
Import-Package: org.eclipse.core.runtime,org.osgi.framework;version="1
.5.0"

  • Tycho 0.16.0存在相同的问题.

  • Tycho 0.16.0 has the same problem.

    有什么想法吗?

    推荐答案

    您看到此行为的原因如下:

    You are seeing this behaviour for the following reasons:

    • org.eclipse.xtext.logging 是一个片段,而不是一个独立的捆绑包(您可以看到,因为它在 MANIFEST中具有 Fragment-Host .MF ,它定义了该片段的另一个束.
    • 片段在p2中的编码方式,片段的 Require-Bundle 可以在p2中解析.基于p2的依赖关系解决方案确定了目标平台的哪些工件已下载到本地Maven存储库.
    • 对片段的 Require-Bundle 在OSGi服务器中无法解析.为了计算类路径(因此,控制台输出解析类路径),Tycho使用了Equinox解析器.该解析器正确检测到对片段的需求绑定无效./li>
    • org.eclipse.xtext.logging is a fragment, not a standalone bundle (you can see that because it has Fragment-Host in the MANIFEST.MF which defines the other bundle to which this one is a fragment of).
    • The way fragments are encoded in p2, a Require-Bundle to a fragment can be resolved in p2. The p2-based dependency resolution determines which artifacts of the target platform are downloaded to the local Maven repository.
    • A Require-Bundle to a fragment will not resolve in an OSGi server. For computing the class path (hence the console output Resolving class path), Tycho uses the Equinox resolver. That resolver detects correctly that Require-Bundle to fragments is invalid.

    这篇关于第谷下载依赖关系,但未能解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆