问题
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:
- Virgo: 2.1
- Eclipse: 3.6
回答1:
I got it working by using STS (Spring Tool Suite) and the tooling for Spring dm Server and associating each bundle with virgo runtime.
回答2:
Given that:
- MANIFEST.MF must be located in src/META-INF/MANIFEST.MF
- "EclipseRT OSGi Bundle" is one of the project facets
- A Virgo Web Server Runtime must also be specified (use the Runtimes tab in the Project Facets window)
Steps to resolve dependencies:
- Open properties on bundle B (right click -> Properties)
- Choose "Project References"
- Check the checkbox next to bundle A
来源:https://stackoverflow.com/questions/6461902/resolving-workspace-dependencies-for-virgo-in-eclipse