【问题标题】:Include directory of jars into bundle with bnd使用 bnd 将 jar 目录包含到 bundle 中
【发布时间】:2021-07-25 09:12:25
【问题描述】:

我能够使用 -includeresource 成功构建包含依赖 jar 的 bnd gradle 插件的捆绑包。但是,当我尝试构建要以编程方式包含的 jar 目录并尝试将整个目录包含到包中时,如下所示:

jar {
    dependsOn copyJars
    // Build OSGI bundle, including the incompatible version of the transitive dependency
    bnd('-exportcontents': 'com.example.foo',
            '-sources': 'false',
            '-includeresource': 'build/tmp/include/=lib/; lib:=true')
}

copyJars 任务有效(我可以看到 jar 文件已被复制),但随后出现此错误:

error  : Input file does not exist: lib/
error  : Input file does not exist: lib/

这没有意义 - lib/ 不是输入,而是输出。

【问题讨论】:

    标签: gradle bnd


    【解决方案1】:

    那是因为它 作为输入文件给出 - 这是错误的方式。应该是:

    '-includeresource': 'lib/=build/tmp/include/; lib:=true')
    

    【讨论】:

      猜你喜欢
      • 2016-09-21
      • 2011-04-24
      • 2010-11-25
      • 2015-12-07
      • 1970-01-01
      • 2013-05-14
      • 2014-02-05
      • 1970-01-01
      • 2011-12-31
      相关资源
      最近更新 更多