Installed plugin not listed in Plug-in selection

江枫思渺然 提交于 2021-01-29 14:16:55

问题


I am currently developing an eclipse plugin and I struggle when it comes to list my plugin dependencies.

I installed the OCL plugin on my eclipse installation and when I want to add it to the project dependencies via the GUI I cannot find it in the plug-in selection list proposed by eclipse.

Even when I reference it manually in the MANIFEST.MF it gives me a warning "org.eclipse.ocl plugin cannot be resolved". However, when I run my plugin as an eclipse application, all is working fine.

I don't know why I get those false signal issues and how to benefit from the Plug-in selection GUI in order to set up the dependencies of my project. Hope that someone have an anwser for that.

Have a good day


回答1:


To avoid such issues I strongly advise you to use a clearly defined target platform instead of relying on the plug-ins installed in your Eclipse IDE instance. Basically, a target platform is an XML file that specifies all the plug-ins that should be in your dev environment.

The pros of using a target platform are that:

  • you don't have to struggle to re-install all the plug-ins in the correct version when you move from an Eclipse IDE instance to another,
  • it is easier to work in a team,
  • you know exactly the plug-ins that are in your dev environment, making it easier to determine why a dependency is not found
  • the target platform can be used to automate the build with Maven and Tycho.

When no target platorm is specified, Eclipse IDE will use the plug-ins available in your Eclipse installation so I find strange that the org.eclipse.ocl bundle cannot be resolved. But let's try to fix that.

1. Check your current target platform

You can use the Target Platform State view to see all the bundles currently provided by the target platform in use:

To open it: Window > Show View > Other... > Plug-in Development

All the plug-ins that you see here can be used as dependencies of your own plug-ins.

If the org.eclipse.ocl bundle is not listed here you should check the details of the target platform in use from the Preferences dialog:

To open it: Window > Preferences > Plug-in Development > Target Platform

If you:

  1. select the target platform,
  2. click on Edit...,
  3. go to the Content tab,

you should see the list of all the plug-ins currently installed in Eclipse. Make sure that org.eclipse.ocl is listed and checked.

2. If the plug-in is not listed in the target platform

Should not happen if at runtime the plug-in behaves as expected, but in this case OCL has not been properly installed.

3. If the plug-in is listed in the target platform and checked

In this case it is likely that Eclipse is a bit confused. You should be able to fix the issue by:

  1. either rebuilding the workspace (Project > Clean... > Clean)
  2. or reloading the target platform (Window > Preferences > Plug-in Development > Target Platform > Select Running Platform > Reload).

In rare occasions I also had to clear all metadata by launching Eclipse IDE in the command line with the -clean -clearPersistedState options.

I know that it may not actually answer your question but since I cannot comment yet I hope it will at least provide you some tips for the future!



来源:https://stackoverflow.com/questions/58271876/installed-plugin-not-listed-in-plug-in-selection

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!