0

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?

oberlies
  • 11,503
  • 4
  • 63
  • 110
user -27
  • 33
  • 5
  • Since this was the solution, you didn't actually try to "add (...) exported package of this bundle" before asking the question, did you? Question and answer would make more sense if you removed this detail from the question. – oberlies Mar 31 '14 at 08:02

1 Answers1

0

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!
Community
  • 1
  • 1
user -27
  • 33
  • 5