问题
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
回答1:
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.
回答2:
Try updating the project configuration.
回答3:
As of August 2011 it is impossible. I only managed to move domain class with roo dependencies into separate maven project. Then I can add it as dependency.
Create maven modules is expected in Spring Roo >= 1.2.M2
来源:https://stackoverflow.com/questions/6660939/how-to-create-maven-module-for-spring-roo-project