开发者

maven m2eclipse multi module project

I have a multi module maven project and the directory structure is hierarchical. S开发者_StackOverflowome modules have dependencies on others. I have added the dependent modules to the dependency section of the project's POM. 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? Why wouldn't the project just resolve the dependent project in the workspace?

thanks, Jeff


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?

No. When you import your projects, unfold the Advanced part and make sure that Resolve Workspace projects is checked (that should be the default though). You can also change this setting at the project level. Just right-click on a project, select Properties > Maven and verify that Resolve dependencies from Workspace projects is checked.

UPDATE: Answering a question asked in a comment by the OP. From https://docs.sonatype.org/display/M2ECLIPSE/Dependency+Management about Include modules:

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜