Question

I'm developing an Eclipse RCP application with Eclipse 4.4 Luna M5 and I'm using Guice 3.0. So I added guice.jar to my target platform and for every plug-in I'm developing I can add bundle com.google.inject to the plug-in's dependencies using the plug-in manifest editor of Eclipse. So far, everything works fine.

Now the problem: I want to use guice assisted injects (@Assisted).

So I added guice-assistedinject.jar to my target platform. (I'm using a .target file = Eclipse Target definition file).

In then "Content" tab of the .target file editor Eclipse correctly shows me the fragment bundle com.google.inject.assistinject 3.0 from guice-assistedinject.jar, but I cannot add this bundle or an exported package of this bundle to the dependencies of the plug-in projects I'm developing.

When I press "Add" in the plug-in manifest editor, com.google.inject.assistedinject is not in the list of addable dependencies? What's wrong?

Was it helpful?

Solution

Here my comment as answer again:

OK, found the solution: it's a PDE problem, see accepted answer in Eclipse OSGi bundle reqiure another bundle's fragment

After changing the manifest of my guice-3.0.jar in the target platform like described in the link above, I needed to do the following:

  1. Reload the target platform (Windows -> Preferences -> Plug-in development -> Target platform) and restart eclipse.
  2. Remove the bundle com.google.inject from the required bundles of my plug-in.
  3. Add all needed com.google.inject packages to "imported packages" of my plug-in. Now in the list of packages I can see com.google.inject.assistedinject.Assisted and import it!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top