我正在尝试使用 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?