“包装"好方法的好方法使用Maven的OSGi的罐子 [英] Good way to "wrap" jars for OSGi with Maven
问题描述
例如,我在OPS4J上查看了PAX工具:这一个,我认为我找到了一种不错的方法:
I was looking at the PAX tools on OPS4J for example: this one and I thought I'd found a nice way to:
- 指定工件
- 根据该jar及其传递的依赖项创建一个组合的jar(包含所有依赖项的jar)
- 用BND包裹起来以创建OSGi包
事实证明,我错了-看来PAX的东西没有做到这一点. (RTFM,对吗?:))
It turns out, that I was wrong - it doesn't appear that the PAX stuff does this. (RTFM, right? :) )
但这让我感到奇怪:那里有什么可以满足我的要求吗?
But this got me wondering: is there something out there that does what I'm asking?
我想也许我可以通过创建一个简单的POM并使用maven-bundle-plugin来做到这一点,但这似乎对我要问的内容有点麻烦.
I've thought maybe I could do this by creating a simple POM and using the maven-bundle-plugin but this seems like it might be a bit cumbersome for what I'm asking.
注意:我知道嵌入和组装jar并不是真正的"OSGi方式"-因此除非我真的觉得有用,否则我不会这样做.例如-春天.
NOTE: I get that embedding and assembling jar's is not really "the OSGi way" - so I wouldn't do this unless I really felt it useful. For example - Spring.
谢谢.
推荐答案
您必须维护本地POM才能完成此操作.没有实用程序可以将库/罐子放入适当的OSGi清单中. ServiceMix与Spring一起捆绑了很多东西,您可以作为示例.我建议看两个这样的例子:
You have to maintain a local POM to get this done. There's not a utility that will take in a library/jar and spit out the appropriate OSGi MANIFEST in a jar. ServiceMix, along with Spring, have a lot of things already bundled up that you can use as examples. Two such examples I suggest looking at are:
- OpenJPA -包装主jar并引入其依赖项
- commons-io - simple library wrapper
- OpenJPA - wraps the main jar and brings in the dependencies with it
这篇关于“包装"好方法的好方法使用Maven的OSGi的罐子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!