using external library (jar) IN maven osgi bundle [netbeans]
I'm using netbeans, project: 'maven OSGI bun开发者_JAVA技巧dle', i have bundle activator running fine in felix (and so on). But I'm not able to add an external JAR (i.e. local) to the bundle itself. In practice let's say i have and utils.jar file I'd like to use IN the bundle (without exporting it), I can't understand why and how it is so difficult (uncommon?).
P.S. I have seen that PAX and Eclipse (i tried only one with no success) may create a bundle from a jar lib, but it still sounds so strange to me that this task is not a common practice.
background:
I did some homework and I'm guessing I'm approaching the problem in the wrong way, so I'm posting for help (hints in the right way). I'm developing a java library (as set of interfaces and implementations) acting as middleware for various projects. The generic problem and scope is very compatible with OSGI arch.
Now the problem is basically: sharing a set of classes/interfaces (=jar library) between bundles (= services and implementations). I like and think that the best approach is having a BASE bundle exporting such library and other bundles as extensions or dependent services as users/providers/actuators.
SOLVED. after a lot of homework and some tests i got it working by finding the mavenized version of the library and using 'Embed-Dependency' keyword (editing pom manually). still dunno how to do that with netbeans ide.
精彩评论