How to work around Eclipse neon 4.6 removal of org.eclipse.core.runtime.compatibility

拟墨画扇 提交于 2019-12-10 17:17:49

问题


Eclipse Neon (4.6) release removed org.eclipse.core.runtime.compatibility, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=476405 where this was mentioned.

Several of our plugins depend on this, and now will not install into this version of Eclipse.

Is there an easy workaround for this, short of reworking these plugins to remove this dependency, which may be a large task?


回答1:


org.eclipse.core.runtime.compatibility is the compatibility layer for Eclipse 2.x (before OSGi: no META-INF/MANIFEST.MF, only plugin.xml, etc.). Eclipse 3.0 was released with this compatibility layer 2004.

Just remove this dependency and look for compile errors. Probably, there will be none and you are done.




回答2:


To migrate our plugins, I did the following:

1) remove the dependencies on org.eclipse.core.runtime.compatibility, org.eclipse.core.runtime.compatibility.auth

2) In the instructions to the maven bundle plugin, changed the Bundle-Activator value from org.eclipse.core.internal.compatibility.PluginActivator to the plugin class itself, which now can have start / stop methods, in place of older startup and shutdown methods.

3) Changed the plugin's 1-argument constructor (which depended on the no-longer-available compatibility classes) to a 0-argument constructor.

4) found various alternatives for old version 2 ways of doing things, like getting the plugin's unique identifier (e.g. replace descriptor.getUniqueIdentifier() with getBundle().getSymbolicName())



来源:https://stackoverflow.com/questions/37993222/how-to-work-around-eclipse-neon-4-6-removal-of-org-eclipse-core-runtime-compatib

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