Search code examples
karafopendaylight

opendaylight: how to include a library jar file?


I am developing a feature (consisting of bundles) for Opendaylight Carbon.

I want to include a third party jar (libary) in my feature. How can I do this? I don't want to include it as a bundle - just as a jar file library that is linked to my bundle.

I don't want to bundle this third party jar. I just want to include it such that it is resolvable by MY bundle. Thanks.


Solution

  • You cannot both not "want to include it as a bundle" NOR "want to bundle this third party jar". How / where from do you expect OSGi (Karaf) to load the classes from your third party JAR then?!

    But bundling is perhaps more easy than you may think, because the maven-bundle-plugin (together with BND which it internally uses) basically can do all the hard work for you if you nicely ask it to via Embed-Dependency.