3

我正在尝试使用 Antbndwrap任务将非 OSGi jar 包装在目录中。我目前的 Ant 配置是:

<target name="wrap-jars" description="Wrap non-OSGi jars">
    <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${biz.aQute:bnd:jar}"/>
    <bndwrap output="${dist.dir}/app-modules">
        <fileset dir="${dist.dir}/app-modules" includes="*.jar" />
    </bndwrap>
    <move overwrite="true" todir="${dist.dir}/app-modules" >
        <fileset dir="${dist.dir}/app-modules" includes="*.bar" />
        <mapper type="glob" from="*.bar" to="*.jar" />
    </move>
</target>

这很好用,但问题是它还包装了现有的 OSGi jar,这会导致问题。例如,我注意到它将Bundle-SymbolicName标头更改为某个默认值。它可能正在改变我不想要的其他东西。我只希望它在根本没有 OSGi 信息的 jar 上运行。

有什么方法可以告诉 BND 忽略清单中现有的 OSGi 标头,或者完整的 jar 已经 OSGi-fied?

4

3 回答 3

0

我会将非 OSGi jar 存储在一个单独的文件夹中,并修改fileset为仅处理该文件夹。

于 2011-11-17T15:03:39.547 回答
0

我注意到最近的 bnd 版本(例如,2.1.0)现在在重新包装 OSGi jar 时尊重 Bundle-SymbolicName。

于 2013-03-06T12:41:54.777 回答
-1

只需更改您的文件集以排除该 jar

于 2013-08-12T21:12:59.087 回答