无法从作为 Maven 依赖项加载的 jar 导入 plugin.xml 中的包?
我想利用 Maven 提供的功能来管理项目中的依赖项。我对 Maven 工作原理的简单理解是,它将获取所需的 JAR,然后使用这些库构建项目。所以我已经在我的电脑上安装并配置了maven。我还在我的 eclipse helios 上安装了 me2eclipse 插件版本 0.12。
我已经创建了一个maven项目并配置了pom。我向 Maven 添加了一些依赖项,并且 Maven 正在检查 %userprofile%/.me2/repository 的依赖 jar。这很好用。但我想从位于我的plugin.xml 的maven 依赖项中的jar 文件导入一些包,这些包通过运行eclipse rcp 插件来使用。 Maven 依赖项也添加到我的类路径中。
不知道错误是什么?任何人都可以帮助我吗?谢谢。
I would like to take advantage of the features that Maven provides for managing dependencies in a project. My brief understanding of how Maven works is that it will aquire the JARs needed and then build the project with these libraries. So i have installed and configured maven on my computer. Also i have installed the me2eclipse plugin version 0.12 on my eclipse helios.
I have been created a maven project and configured the pom. I added some dependencies to maven and maven was checking out the dependend jars to %userprofile%/.me2/repository. This works fine. But i would like to import some packages from the jar files which are located at the maven dependencies at my plugin.xml which are used by running a eclipse rcp plugin. The maven dependencies are added to my classpath as well.
I don't know were the mistake is? Can any body help my. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案是,不可能从 eclipse rcp 插件依赖项或 MANIFEST 中作为 Maven 依赖项(存储在 Maven 本地存储库)加载的 jar 或捆绑包导入某些包。您只能从位于 eclipse 目标平台的 jar 导入捆绑包或包。因此,解决方案是将本地 Maven 存储库中的包也添加到目标平台。
The answer is, thats not possible to import some packages from jars or bundles which are loaded as maven dependency (stored at the maven local repositiry) at the eclipse rcp plugin dependency or MANIFEST. You can only import bundles or packages from jars which are located at the eclipse target platform. So the solution is to add the bundles which ar located at the local maven repository to the target platform as well.
您应该深入了解 Maven-Felix 在这种建筑中为您提供支持。此外,我建议您更新到 Eclipse-Indigo 并使用集成的(市场)m2e 而不是旧的 m2eclipse 插件。
You should take a deep look at Maven-Felix which supports you in this kind of building. Furthermore i recommend you to update to Eclipse-Indigo and use the integrated (Marketplace) m2e instead of the old m2eclipse plugin.