如何使用 bndtools 解析 org.slf4j

问题描述

我目前正在尝试将 bndtools 用于一个简单的 Osgi 测试项目,以评估 bnd/bndtools。现在我正在努力让 bndtools 自动解决我的项目的运行要求。我收到以下错误

Resolution Failed. Capabilities satisfying the following requirements Could not be found:
    [<<INITIAL>>]
      ⇒ osgi.identity: (&(osgi.identity=test.bndtools)(version>=1.0.0.202102160605))
          ⇒ [test.bndtools version=1.0.0.202102160605]
              ⇒ osgi.wiring.package: (&(osgi.wiring.package=org.slf4j)(version>=1.7.0)(!(version>=2.0.0)))

我的 bnd 构建路径是

-buildpath: \
    org.osgi.service.component.annotations;version='1.4.0',\
    slf4j.api;version='1.7.30'

但即使我将 org.slf4j 1.7.30 添加到我的构建路径中,我仍然遇到相同的错误(是的,它绝对可用)。 另外如果我只使用

-runrequires: \
    bnd.identity;version='1.1.0';id='org.apache.Felix.gogo.command',\
    bnd.identity;version='1.1.2';id='org.apache.Felix.gogo.shell',\
    bnd.identity;version='1.1.2';id='org.apache.Felix.gogo.runtime'

作为运行要求一切都很好,直到我添加 bnd.identity;version='1.7.30';id='slf4j.api' 到运行要求。那么错误

Resolution Failed. Capabilities satisfying the following requirements Could not be found:
    [<<INITIAL>>]
      ⇒ osgi.identity: (&(osgi.identity=slf4j.api)(version>=1.7.30))

我的最后一次尝试是添加 slf4j.simple 作为运行要求,但这并没有改变任何东西。 如果我手动将 slf4j 添加到 runbundle,一切都很好,只有根据运行要求解析要运行的包列表失败。其他依赖项也可以正常工作。是我遗漏了什么还是由于 slf4j 包的结构而损坏了?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)