Search code examples
javamavenm2eclipsespring-roo

How to create maven module for Spring Roo project?


I have Spring Roo project. It is maven project. So I would like to use maven modules to make my growing project modular. However when I try to create module project( with m2eclipse right-click project, then Maven -> New Maven Module Project). It is created OK, it get's all maven dependencies/libraries from parent project.

But: 1) I cannot use classes from parent project (even though "Resolve dependencies from Workspace projects" is checked)

2) I cannot use Roo shell. I can run shell, but cannot add entity. And I can't add persistence.

roo> persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
additionalBuildcommands element of the maven-eclipse-plugin required

Solution

  • But: 1) I cannot use classes from parent project (even though "Resolve dependencies from Workspace projects" is checked)

    That's right. parent projects of multi-module projects must have packaging pom, which means that no classes will be compiled. A parent project should be a wrapper for multiple child projects, nothing more.