开发者

How to create an osgi fragment with Bnd?

Today I had a deeper look inside the bndTools for Eclipse. I had a good start, but I ask myself if it is possible to开发者_JAVA百科 create osgi fragments with bndTools or bnd. From the bnd project description it tells me that the Fragment-Host header is ignored by bnd, but have not found out what this means.

Does someone know if creating a osgi fragment is possible with bnd, and if so how to do that?

Regards Markus


A fragment bundle is special in only two ways:

  • it cannot be started, so it should not contain a Bundle-Activator header, and
  • it needs to contain a Fragment-Host header with the symbolic name of the host you want to attach to.

Other than that, it's a bundle like any other, so bnd does not need to handle this in any special way. bnd by default 'ignores' all headers it doesn't recognize, in which case it copies them verbatim to the resulting bundle's manifest.

In Bndtools, you can add custom headers (i.e., those not directly supported by Bndtools) in the Source tab.


bnd does exactly what it says. It ignores any Fragment-Host lines that you add and transparently copies them to the output bundle as opposed to processing those lines. Just add the Fragment-Host lines you need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜