How to convert jar to OSGi bundle using eclipse and bndtools

前端 未结 3 993
陌清茗
陌清茗 2020-12-03 03:57

I am looking for a step by step guide to convert jar into an OSGi bundle using the eclipse bndtools plugin. I know it is possible to do it with bnd using the command line bu

3条回答
  •  时光说笑
    2020-12-03 04:43

    Follow the article Create Eclipse plugins (OSGi bundles) from standard jar to achieve this. Though this approach does not use Bnd, but you would be able to achieve what you want.

    In short you can do following:

    1. Create a new Plugin project by selection File-> New -> Project...-> Plug-in Development -> "Plug-in from Existing JAR Archives"

    2. Select jars you want to have in this new plugin(bundle). Enter other plugin data(name, version, id etc.).

    3. Uncheck the flag Unzip the JAR archive into the project. Press then finish.

    Unchecking the checkbox Unzip the JAR archive into the project, prevents extracting class files from the Jar which is usually not necessary.

    EDIT : To Export your bundle to install it into a OSGi runtime. Select your bundle and choose File -> Export -> Plug-in Development -> "Deployable plug-ins and fragment".

    Uncheck the checkbox to Export source.

提交回复
热议问题