In a PDE project is there a way to add third party bundles from the file system as a dependency for my project? I am looking to do the same thing that the BND tool allows; add a bundle to the local repository and then import the packages from that bundle in the project. I do not want to use the maven osgi plugin.

I have already tried creating a user library with the external bundle and setting it to the project's build path but that did not help.

有帮助吗?

解决方案

What you're after is the target platform. Any bundle in the target platform is on the build path of projects with the right package imports. The tool to create a target platform is under Window->Preferences->Plug-in Development->Target Platform.

其他提示

You can use a convention for your Plug-in development where you create a directory "bundles" (or "lib") in each project. Edit the Target Platform (as described by Holly) and add a new Location using the project_loc variable:

${project_loc}/bundles

Then for each project any plug-ins in its bundles directory will automatically be avaliable as a dependancy. (if a new bundle doesn't show up immediately go to Target Platform in Preferences with your project selected and it will refresh).

If you use Run As... OSGi Framework to test your bundle and it cannot find the external bundle you will need to go to Run As... > Run Configurations... and make sure the bundle is checked in the list for the target platform.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top