安装
- windows 环境
- 在环境变量中新建SPRINGROO_HOME=springroo路径,如C:\spring-roo-1.0.1
- 在环境变量PATH中,增加%SPRINGROO_HOME%\bin;
- 在开始->运行中输入cmd,弹出DOS窗口后,然后输入"roo",如果有以下字样:Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
恭喜你,表示成功安装.spring roo 由于maven 问题,暂时不能在linux环境下使用,正在解决中。
命令使用
spring roo提供了非常多的命令工具,常用如下:
-
- help
帮助。用来显示所以spring roo命令以及使用办法 - exit
退出。退出roo操作环境 - biz bundle add (name 参数代表bundle名字.biz bundle 操作必须项目的app/biz目录下使用)
创建biz bundle。比如:biz bundle add --name user - biz bundle remove (name 参数代表bundle名字)
删除biz bundle。比如:biz bundle remove --name user(删除功能仅是对parent pom和总pom进行更新,文件夹还是存在的,需自行删除) - synEarPom
主要用于将主Pom.xml内容同步到assembly下ear/pom.xml中。此命令必须在项目根目录下使用,其他目录下将不能使用 - web bundle add (name 参数代表bundle名字.web bundle 操作必须项目的app/web目录下使用)
创建web 模块 bundle。比如:web bundle add --name user - web bundle remove (name 参数代表bundle名字)
删除web 模块 bundle。比如:web bundle remove --name user - bundle add(name 参数代表bundle名字)
相当于同时执行biz bundle add 和 web bundle add,注意该命令要在根目录执行。比如: bundle add --name user - bundle remove(name 参数代表bundle名字)
相当于同时执行biz bundle remove 和 web bundle remove,注意该命令要在根目录执行。比如: bundle remove --name user
注意:roo自身还提供了很多其他功能,但结合公司情况暂不能使用。 - service bundle add(name 参数代表bundle名字)
创建common-service-'name' bundle,必须在common/service目录执行。比如:service bundle add --name user - service bundle remove(name 参数代表bundle名字)
删除common-service-'name' bundle,必须在common/service目录执行。比如:service bundle remove --name user
- help
ps:请保证roo的执行目录中没有中文,不然会创建失败。