Gradle 使用bnd将jar目录包含到bundle中
我能够使用Gradle 使用bnd将jar目录包含到bundle中,gradle,bnd,Gradle,Bnd,我能够使用-includeresource成功构建一个包含依赖项jar的bnd-gradle插件包。但是,当我尝试以编程方式构建jar目录以包含时,并尝试将整个目录包含到捆绑包中,如下所示: jar { dependsOn copyJars // Build OSGI bundle, including the incompatible version of the transitive dependency bnd('-exportcontents': 'com.exa
-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/
不是一个输入,而是一个输出。这是因为它是作为输入文件提供的-这是错误的。应该是:
'-includeresource': 'lib/=build/tmp/include/; lib:=true')