Bundle导出的包不可见

发布于 2024-09-13 17:41:40 字数 949 浏览 9 评论 0原文

我有一堆 eclipse 插件,它们依赖于包含一些第三方 jar/dll 资源的包,并导出这些资源包含的包。 当我将所有这些导出并放入 eclipse/plugins 中时,插件可以完美运行。但是,当我在这个新工作区中创建一个依赖于我的资源包的新插件时,我看不到其导出的包。我似乎根本找不到他们。

资源包的清单如下所示:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MyBundle
Bundle-SymbolicName: MyBundle
Bundle-Version: 1.0.0
Bundle-ClassPath: res1.jar,
 res2.jar,
 res3.jar,
 .
Export-Package: com.stuff.res2,
 com.stuff.res1,
 com.stuff.res3
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

我已经浏览了 这个相关线程,没有运气。 经过一些额外的谷歌搜索后,我找到了一种解决方法,可以将我的包作为项目导入工作区(在插件浏览器中右键单击我的包 - >导入为 - >源/二进制项目)。如果可能的话,我想避免创建这个额外的项目。

编辑: Eclipse bug 259959 看起来可能相关,但不是和我完全一样的设置。

任何帮助将非常感激!

I have a bunch of eclipse plugins that depend on a bundle that contains some third-party jar/dll resources, and exports the packages those resources contain.
When I export and drop all this into eclipse/plugins, the plugins work perfectly. However, when I make a new plugin dependent on my resource bundle in this new workspace, I can't see its exported packages. I can't seem to find them at all.

The resource bundle's manifest looks like this:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: MyBundle
Bundle-SymbolicName: MyBundle
Bundle-Version: 1.0.0
Bundle-ClassPath: res1.jar,
 res2.jar,
 res3.jar,
 .
Export-Package: com.stuff.res2,
 com.stuff.res1,
 com.stuff.res3
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

I've gone through the checklist in this related thread, with no luck.
After some additional googling, I found a workaround where I can import my bundle as a project into the workspace (Right-click on my bundle in Plug-in Browser --> Import As --> Source/Binary Project). I'd like to avoid creating this extra project though, if at all possible.

edit: Eclipse bug 259959 looks like it might be related, but not quite the same setup as me.

Any help would be really appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

烟花肆意 2024-09-20 17:41:40

不要创建一个充满其他 jar 的库包。 这不会按你想要的方式工作它到。除了该链接中提供的解决方案之外,您还可以从库 jar 创建自己的捆绑包。 Eclipse 具有从现有 jar 创建的选项,当然这意味着每个 jar 都有一个新的包,但这无论如何都是在 OSGi 环境中执行此操作的正确方法。

Don't create a library bundle filled with other jars. This won't work as you want it to. In addition to the solutions offered in that link, you can also create your own bundles from the library jars as well. Eclipse has that option to create from existing jar, of course this means a new bundle for each jar, but that would be the proper way of doing it anyway in an OSGi environment.

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