I've just spent the last hour looking at threads on Stackoverflow.com , trying to import a Maven project in to Spring ToolSuite 2.5.2.
The Maven project has multiple modules, when I use the Import... wizard in STS to import the project All the Modules are listed in the Package Explorer and some of the modules dependencies are not resolved.
Can any advise on the proper way to import a Multi-Module Maven project in to STS/Eclipse such that all the modules appear under a Parent directory? And so all the modules dependencies are resolved?
The project is in a hierarchy on the file system, I've tried the various Update Dependencies, Project Configuration options but all to no avail. I have an embedded version of Maven installed in the IDE.
Thanks for your time.
M2Eclipse does a very good job at resolving inter-project dependencies. If it doesn't work, perhaps your project structure has errors. Check that:
<module>
in the parent pom (profile must be active if the module is defined in a profile).If these versions don't match, the artifacts referenced will be pulled from the local repository, not the eclipse workspace.
About common root projects: I don't think it's a good idea to have a common Project, but the Eclipse concept that comes to mind (and that I use for multi-module projects) is a Working Set.
In the Package Explorer, switch the Top Level Elements
to Working Sets
:
Now choose Configure Working Sets ...
from the same menu.
Here's a working set with the maven3 trunk and all submodules as separate projects: