简体   繁体   English

Eclipse中的多模块Maven项目

[英]Multi-module Maven project in 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? 我可以在Eclipse中将项目仍作为一个项目还是将其设为单独的项目吗?

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? 当我将依赖项从父pom.xml移到子项时,它们不再放在Eclipse构建路径上,因此现在这些文件都无法在Eclipse中编译(尽管看起来确实Mav​​en在命令行中工作。)我可能做错了什么或在Eclipse中创建多模块项目的提示?

I finally managed to get this working. 我终于设法使它工作了。 It's a hierarchy on the file system, but they show up in Eclipse as separate projects. 它是文件系统上的层次结构,但它们在Eclipse中显示为单独的项目。

Eg on the file system we have: 例如,在文件系统上,我们有:

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

But in Eclipse, it shows as: 但是在Eclipse中,它显示为:

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

To get them to show up in Eclipse you have to do: 要使它们显示在Eclipse中,您必须执行以下操作:

File > Import... > Existing Maven Projects

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM