javaeclipseosgispringsource-dm-servereclipse-virgo

Resolving workspace dependencies for Virgo in Eclipse


I'm looking to get started with Eclipse Virgo, so I grabbed the required plugins for Eclipse based on the Programmer Guide.

Next, I started two new projects in my Eclipse workspace, both configured as Virgo bundles (call these A and B). Then, I created a new class com.foo.Bar in bundle B. I modified the Manifest of bundle B to export com.foo, saved. Last, I imported com.foo in bundle A.

Bundle A's manifest has an error:

Import-Package: com.foo [0.0.0, oo) could not be resolved

What do I need to do to configure Eclipse to resolve dependencies using the projects in my workspace?

I've already tried adding bundle B to the build path of bundle A, but this makes no difference. (It's worth noting that adding bundle B to the build path of bundle A, even if it had worked, isn't a suitable solution because the dependency management needs to be done differently.)

Details of note:


Solution

  • Given that:

    1. MANIFEST.MF must be located in src/META-INF/MANIFEST.MF
    2. "EclipseRT OSGi Bundle" is one of the project facets
    3. A Virgo Web Server Runtime must also be specified (use the Runtimes tab in the Project Facets window)

    Steps to resolve dependencies:

    1. Open properties on bundle B (right click -> Properties)
    2. Choose "Project References"
    3. Check the checkbox next to bundle A