gpt4 book ai didi

maven-2 - maven m2eclipse 多模块项目

转载 作者:行者123 更新时间:2023-12-04 11:45:32 24 4
gpt4 key购买 nike

我有一个多模块 Maven 项目,目录结构是分层的。一些模块依赖于其他模块。我已将依赖模块添加到项目 POM 的依赖部分。但是,为了解决这些依赖关系,我需要导入父项目,然后选择 Project Properties > Maven 并选择“Enabled Modules”。这是正常的吗?为什么项目不解决工作区中的依赖项目?

谢谢,
杰夫

最佳答案

However, in order to resolve those dependencies, I need to import the parent project, and select Project Properties > Maven and select "Enabled Modules." Is this normal?



不会。当您导入项目时,展开 高级 部分并确保 解决工作区项目 已选中(但这应该是默认设置)。
您还可以在项目级别更改此设置。只需 右键在一个项目上,选择 属性 > Maven 并验证 解决来自 Workspace 项目的依赖关系 被检查。

更新:回答 OP 在评论中提出的问题。来自 https://docs.sonatype.org/display/M2ECLIPSE/Dependency+Management关于 包含模块 :

When enabled, dependencies from all nested modules are added to the "Maven Dependencies" container and source folders from nested modules are added to the current project build path when running "Update Sources" action. This option is enabled when you import multiple Maven projects as single Eclipse project, e.g. when "Separate projects for modules" option is turned off in the project import wizards.

关于maven-2 - maven m2eclipse 多模块项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2061499/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com