How to OSGIfy a library

后端 未结 1 707
情深已故
情深已故 2021-02-09 07:25

I\'m working on a project, it\'s integration project, we are using Apache Camel and Apache Karaf. In the project, I need to use the Jira REST Java client library.

So I\'

1条回答
  •  名媛妹妹
    2021-02-09 08:10

    Yes OSGi is IMHO "far from easy to use" in terms of its deployment model, requiring 100% bundles with osgi metadata in MANIFEST.MF files. And you need a PhD in mathematics to understand the BND tool. And unfortunately many JARs are not OSGi bundles.

    Looking at your pom.xml file with all the imports|exports, and that "not easy to understand" syntax, would just take 5-sec for any average engineer to understand that this "something is wrotten in the state of Denmark" ; eg OSGi != the world we live in. This must and should be easier IMHO.

    You can install a plain JAR in Karaf using the wrap url handler: http://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html

    Another trick is to create an uber JAR, eg to put it all in a single JAR file and then you can deploy that.

    There is also FAB (Fuse Bundles) which makes OSGi deployment easier, as it handles much of this craziness for you at deploy time, instead of you having to deal with the OSGi MANIFEST.MF madness: http://www.davsclaus.com/2012/08/osgi-deployment-made-easy-with-fab.html

    0 讨论(0)
提交回复
热议问题