Eclipse 中的多模块 Maven 项目

发布于 2024-10-04 13:28:25 字数 210 浏览 0 评论 0原文

我有一个项目,我想将其分成多个模块。我是否仍可以将 Eclipse 中的项目作为单个项目,还是需要将它们设为单独的项目?

当我将依赖项从父级 pom.xml 移至子级 pom.xml 时,它们不再被放在 Eclipse 构建路径上,因此现在没有任何文件可以在 Eclipse 中编译(尽管 Maven 确实是从命令行工作的。)我可能做错了什么或者在 Eclipse 中创建多模块项目的提示?

I have a project which I'd like to split into multiple modules. Can I still have the project in Eclipse as a single project or do I need to make them separate projects?

When I moved the dependencies from the parent pom.xml to the child's they stopped being put on the Eclipse build path and so now none of the files will compile in Eclipse (though it did appear Maven was working from the command line.) And ideas what I might be doing wrong or tips for creating multi-module projects in Eclipse?

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

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

发布评论

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

评论(1

给我一枪 2024-10-11 13:28:25

我终于成功地让这个工作了。它是文件系统上的层次结构,但它们在 Eclipse 中显示为单独的项目。

例如,在文件系统上我们有:

parent
  |
  |-- child A
  |
  |-- child B

但在 Eclipse 中,它显示为:

  |-- parent
  |
  |-- child A
  |
  |-- child B

要让它们显示在 Eclipse 中,您必须执行以下操作:

File > Import... > Existing Maven Projects

I finally managed to get this working. It's a hierarchy on the file system, but they show up in Eclipse as separate projects.

E.g on the file system we have:

parent
  |
  |-- child A
  |
  |-- child B

But in Eclipse, it shows as:

  |-- parent
  |
  |-- child A
  |
  |-- child B

To get them to show up in Eclipse you have to do:

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