Access osgi bundle lib jars

I am developing an osgi package that requires org.apache.http packages. There is an httpcommponents package on the target platform that has these packages because I saw them when I declared the manifest of these dependencies in the package, and eclipse automatically added the package to the dependency list of the plug-in. The problem is that I get compilation errors while I am import org.apache.http. If I examine the package, it only has Activator in the org.apache.http package and there are banks in the lib folder with the packages I need. How can I access these packages? Run the activator and get the classes that I need at runtime? The solution might be to manually add the jar org.apache.http to my package build path. Sorry if this is a stupid question ...

thank

+3
source share
2 answers

You can look at this question regarding your build problem. The one who built your target platform takes the wrong approach, which causes your grief.

Your target platform should use the OSGi version of the public libraries . When ready-made versions of OSGi are not available, you can get them from the Springsource package repository .

If this is not an option (to fix this problem), you can simply change your class path for your assembly to include the appropriate libraries. It should already be running at runtime independently.

PS - This is not a stupid question :-)

+1
source

, OSGi org.apache.http, . . , - OSGi Bundle Repository (OBR). OBR, , .

OBR, maven OSGi. OBR . OBR .

0

All Articles