Question

I have a multi module maven project and the directory structure is hierarchical. Some 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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top