更改 Eclipse 插件的 ID (Bundle-SymbolicName)

发布于 2024-10-21 14:01:35 字数 261 浏览 6 评论 0原文

我正在开发一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深居我梦 2024-10-28 14:01:35

插件 ID 似乎不仅存储在项目中,还(暂时)存储在您正在开发它的工作区中,例如文件 ${workspace_loc}\.metadata\.plugins\org.eclipse 中。 pde.core\Eclipse Application\dev.properties,它似乎存储了您正在使用的每个插件的 bin 文件夹的路径。您可以通过打开运行配置并查看“配置”选项卡上显示的配置位置来查看这一点。

更新此内容的最简单方法显然是重新启动 Eclipse(您正在开发的平台,而不是目标平台)。这将更新这些文件,然后插件应该使用新的 ID。您还可以在运行配置中选择“启动前清除配置区域”。

步骤如下:

  1. 打开plugin.xml 编辑器并更改Overview 选项卡上的ID 字段。
  2. 将 Activator 中的字符串 PLUGIN_ID 更新为相同的值。
  3. 重新启动 Eclipse。

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:

  1. Open the plugin.xml editor and change the ID field on the Overview tab.
  2. Update the string PLUGIN_ID in your Activator to the same value.
  3. Restart Eclipse.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文