更改 Eclipse 插件的 ID (Bundle-SymbolicName)
我正在开发一个 Eclipse(编辑器)插件并尝试更改其 ID。每当我这样做时,我都会收到很多 ClassNotFoundExceptions
,例如对于我的 TextEditor
子类。
我确实替换了 Activator(AbstractUIPlugin
子类)中的 PLUGIN_ID
字符串文字,但这没有帮助。
要更改 Eclipse 插件的插件 ID,我需要做什么?
I'm working on an Eclipse (editor) plugin and trying to change its ID. Whenever I do that, I get lots of ClassNotFoundExceptions
, e.g. for my TextEditor
subclass.
I did replace the PLUGIN_ID
string literal in the Activator (the AbstractUIPlugin
subclass), but that didn't help.
What do I have to do to change the plugin ID of an Eclipse plugin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
插件 ID 似乎不仅存储在项目中,还(暂时)存储在您正在开发它的工作区中,例如文件
${workspace_loc}\.metadata\.plugins\org.eclipse 中。 pde.core\Eclipse Application\dev.properties
,它似乎存储了您正在使用的每个插件的 bin 文件夹的路径。您可以通过打开运行配置并查看“配置”选项卡上显示的配置位置来查看这一点。更新此内容的最简单方法显然是重新启动 Eclipse(您正在开发的平台,而不是目标平台)。这将更新这些文件,然后插件应该使用新的 ID。您还可以在运行配置中选择“启动前清除配置区域”。
步骤如下:
Overview
选项卡上的ID
字段。PLUGIN_ID
更新为相同的值。PS:我不能再轻易地重现这个问题了。现在更新我的插件的 ID 似乎也会更新我的工作区中的引用。不过我会保留这个,也许它对某人有帮助。
The plugin ID seems to be not only stored in the project, but also (temporarily) in the workspace you're developing it in, e.g. in the file
${workspace_loc}\.metadata\.plugins\org.eclipse.pde.core\Eclipse Application\dev.properties
, which seems to store the path to the bin folder for each plugin you're working on. You can see that by opening your run configuration and looking at the configuration location shown on the 'Configuration' tab.The easiest way to update this is apparently to just restart Eclipse (the one you're developing in, not the target platform). That will update these files and the plugin should then work with the new ID. You might also get away with selecting the 'Clear the configuration area before launching' on your run configuration.
So the steps are:
ID
field on theOverview
tab.PLUGIN_ID
in your Activator to the same value.PS: I can no longer easily reproduce this problem. Updating the ID of my plugin now also seems to update the references in my workspace. I'll keep this around though, maybe it helps someone.