如何通过Maven添加Eclipse插件项目的依赖项

发布于 2025-01-24 15:07:06 字数 824 浏览 2 评论 0原文

我正在为Eclipse的XTEXT/XTEND插件工作。我的项目结构包含各种插件项目。该项目是作为Maven项目创建的,并转换为Xtend项目。开发和建筑物效果很好,但是现在我要在一个插件项目中添加依赖关系(org.apache.poi)。

我从Maven Central中添加了< dependenty>在父级项目中的pom.xml,并将其下载到我的本地Maven Repo。到目前为止还不错,但是当我尝试导入org.apache.poi.xssf.usermodel.xssfworkbook在(儿童)插件项目之一中无法解决。

在平原Xtend项目中使用Maven时,使用它没有问题。将< dependenty>添加到我的pom.xml之后,之后我可以使用它。因此,我想问题在于一个事实,我现在正在处理一个插件项目。例如,在平原XTEND项目中,我有一个“ Maven依赖关系”类Pather容器,我在插件项目中没有该容器。

我尝试过的是:

  • <依赖关系>添加到我的父母和/或我想使用的子女插件项目中的pom.xml中
  • 到目前为止, (打开pom.xml - >添加依赖项)
  • 通过插件项目上的右MB添加了依赖项 - > Maven->添加依赖性
  • Maven Update Project Project Project
  • Project install -U
  • 添加依赖项清洁/构建项目

在清单中

后。将Maven依赖性添加到Eclipse的插件项目的方法是什么?

I'm working on a Xtext/Xtend based plugin for Eclipse. My project structure contains of various Plug-In projects. The project was created as a maven project and converted to an Xtend project. Developing and building works fine but now I'm at a point where I want to add a dependency (org.apache.poi) to one of the plug-in projects.

I added the <dependency> node from maven central to my pom.xml in the parent project and it got downloaded to my local maven repo. So far so good but when I try to import org.apache.poi.xssf.usermodel.XSSFWorkbook in one of the (child) plug-in projects it can't be resolved.

When using maven in a plain Xtend project I have no problems using it. After adding the <dependency> to my pom.xml I'm able to use it afterwards. So I guess the problem lies in the fact, that I'm now dealing with a plug-in project. At the plain Xtend project, for example, I have a "Maven Dependencies" classpath container which I don't have in my plug-in project.

What I've tried so far:

  • added the <dependency> to the pom.xml in my parent and/or the child plug-in project where I want to use it
  • added the dependency via Eclipse GUI (opened pom.xml -> Add Dependency)
  • added the dependency via right MB on plug-in project -> maven -> Add Dependency
  • Maven Update Project
  • clean install -U after adding the dependency
  • clean/build project

In the MANIFEST.MF I can't add the dependency as it is not shown in the list of dependencies to choose.

What's the way of adding maven dependencies to a plug-in project in Eclipse?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文