OSGI - handling 3rd party JARs required by a bundle

前端 未结 6 1832
感情败类
感情败类 2020-12-02 12:07

I\'m just getting started with OSGI development and am struggling to understand how best to handle dependant JARs.

i.e. if I\'m creating a bundle the likelyhood is t

6条回答
  •  一向
    一向 (楼主)
    2020-12-02 13:04

    You can include a third party jar inside your bundle by adding the third party jar to the root directory of the bundle jar file and then adding a bundle classpath header to the bundle's manifest, e.g.:

    Bundle-ClassPath: .,my3rdparty.jar
    

    If you want to place third party jar to subdirectory, specify the path without using heading ./, e.g

    Bundle-ClassPath: .,lib/my3rdparty.jar # (not ./lib/my3rdparty.jar)
    

提交回复
热议问题