Maven m2eclipse project with multiple modules

I have a project with several maven modules and the directory structure is hierarchical. Some modules are dependent on others. I added the dependent modules to the dependencies section of the POM project. However, in order to resolve these dependencies, I need to import the parent project and select Project Properties> Maven and select Included Modules. This is normal? Why did the project not just allow the dependent project in the workspace?

thanks jeff

+7
maven-2 m2eclipse multi-module
source share
1 answer

However, in order to resolve these dependencies, I need to import the parent project and select Project Properties> Maven and select Included Modules. This is normal?

Not. When you import your projects, expand the Advanced section and make sure that Workspace projects are solved (this should be the default). You can also change this setting at the project level. Just right-click in the project, select Properties> Maven and make sure that Allow dependencies from Workspace projects are checked .

UPDATE: Responding to a question posed in an OP comment. From https://docs.sonatype.org/display/M2ECLIPSE/Dependency+Management o Enable Modules :

When enabled, dependencies on all sub-modules are added to the "Maven Dependencies" container, and the source folders from the sub-modules are added to the current project build path when the "Update Sources" action is launched. This option is enabled when you import multiple Maven projects as a single Eclipse project, for example. when the option "Separate projects for modules" is disabled in the project import wizards .

+8
source share

All Articles