How to create maven module for Spring Roo project?

≡放荡痞女 提交于 2019-12-08 08:15:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!