由于org.eclipse.e4.ui.workbench.swt中违反了使用约束,因此无法解决捆绑软件

时间:2019-01-08 06:50:57

标签: java eclipse osgi eclipse-rcp

我正在尝试构建我的RCP插件,并且在尝试运行tycho surefire测试时遇到此错误-

Bundle was not resolved because of a uses contraint violation. org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.eclipse.e4.ui.workbench.swt [osgi.identity; osgi.identity="org.eclipse.e4.ui.workbench.swt"; type="osgi.bundle"; version:Version="0.14.1.v20160829-0832"; singleton:="true"] because it is exposed to package 'org.osgi.service.component' from resources org.eclipse.osgi.services [osgi.identity; osgi.identity="org.eclipse.osgi.services"; type="osgi.bundle"; version:Version="3.6.0.v20170116-1355"] and osgi.enterprise [osgi.identity; osgi.identity="osgi.enterprise"; type="osgi.bundle"; version:Version="4.2.0.v201108120515"] via two dependency chains.

  Chain 1:
  org.eclipse.e4.ui.workbench.swt [osgi.identity; osgi.identity="org.eclipse.e4.ui.workbench.swt"; type="osgi.bundle"; version:Version="0.14.1.v20160829-0832"; singleton:="true"]
    require: (&(osgi.wiring.bundle=org.eclipse.osgi.services)(&(bundle-version>=3.2.0)(!(bundle-version>=4.0.0))))
     |
    provide: osgi.wiring.bundle: org.eclipse.osgi.services
  org.eclipse.osgi.services [osgi.identity; osgi.identity="org.eclipse.osgi.services"; type="osgi.bundle"; version:Version="3.6.0.v20170116-1355"]

Chain 2:
  org.eclipse.e4.ui.workbench.swt [osgi.identity; osgi.identity="org.eclipse.e4.ui.workbench.swt"; type="osgi.bundle"; version:Version="0.14.1.v20160829-0832"; singleton:="true"]
    require: (&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))
     |
    provide: osgi.extender; osgi.extender="osgi.component"; version:Version="1.2.0"; uses:="org.osgi.service.component"
  org.eclipse.equinox.ds [osgi.identity; osgi.identity="org.eclipse.equinox.ds"; type="osgi.bundle"; version:Version="1.4.400.v20160226-2036"; singleton:="true"]
    import: (&(osgi.wiring.package=org.osgi.service.component)(&(version>=1.1.0)(!(version>=1.3.0))))
     |
    export: osgi.wiring.package: org.osgi.service.component
  osgi.enterprise [osgi.identity; osgi.identity="osgi.enterprise"; type="osgi.bundle"; version:Version="4.2.0.v201108120515"]

1 个答案:

答案 0 :(得分:1)

似乎您已将捆绑软件osgi.enterprise安装到OSGi Framework中。该捆绑软件不应该在运行时使用-它是一个规范聚合捆绑软件,仅在编译时使用。

只需从运行时中删除捆绑软件,就可以了。