Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can I not access all plugins in my target definition?

I have a problem concerning target definitions in Eclipse. I want to use plugin version 1.0.0, which is in my target platform definition, while I have the plugin project in my workspace with version 1.0.2. For all other plugins in my target definition, everything works as expected (which I see because an error gets flagged if something's missing), but this specific one, Eclipse does not make available to my projects. Only the plugin version 1.0.2 is. The plugin is not set as a singleton.

Why is this and how can I resolve this problem?


I figured out that I can access the right version when I close the project that contains the wrong one - but this is awkward, is there another way?


It seems that it's actually not an eclipse-specific problem, it fails also when building on the command line through maven/tycho. Specifically, my target platform is the Juno Release. Are there plugins that, while part of a feature, are not made available to other bundles? I know the plugin is there, but neither tycho nor Eclipse want to make it available to me.

Maybe I should also say it fails at compile time.


While, as I said, there exist workarounds for the problem, I still would like to have a "nice" solution to this problem. You can check out the project together with the target definition at https://github.com/kutschkem/Jayes

You may also need to check out and build this project first: git clone http://git.eclipse.org/gitroot/recommenders/org.eclipse.recommenders.git

After setting the target platform, try building something with Jayes 1.0.0 (which is in the target platform) instead of Jayes 1.0.2 (which is in your workspace). You can also try to build with maven, it doesn't work as well.

Known workarounds:

  1. Close the Jayes 1.0.2 project. Then, eclipse lets you use Jayes 1.0.0
  2. For running an (OSGi) application, you can choose which bundles are loaded. You can choose version 1.0.0 manually there
  3. Using a product definition, you can access the same runtime configuration as for workaround 2

If someone finds a workaround for maven, I'd be happy to know about it.

like image 868
kutschkem Avatar asked Dec 11 '12 07:12

kutschkem


1 Answers

Maybe you have set your plugin to be singleton, so there will only be one instance for the bundle with a specific id. You can change this by remove the "singleton:=true" in your MANIFEST.MF.

Bundle-SymbolicName: org.eclipse.xxx; singleton:=true

Or, you could remove the 1.0.2 version plugin from the run configuration when start running. click run --> run configuration to open the run configuration dialgo, switch to 'plugins' tab, here you can select which of these plugins you want to use .

like image 110
Dollyn Avatar answered Oct 23 '22 12:10

Dollyn