使用SpringRoo 为Maven项目添加新模块

本文详细介绍了如何在Windows环境下安装Spring Roo,并通过实际操作演示了Spring Roo的基本命令,包括帮助、退出、创建bizbundle、删除bizbundle、同步主Pom.xml内容、创建web模块bundle、删除web模块bundle、创建common-service bundle、删除common-service bundle等。此外,文章还特别指出由于maven问题,Spring Roo目前无法在Linux环境下使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

安装

  1. windows 环境
    1. 在环境变量中新建SPRINGROO_HOME=springroo路径,如C:\spring-roo-1.0.1
    2. 在环境变量PATH中,增加%SPRINGROO_HOME%\bin;
    3. 在开始->运行中输入cmd,弹出DOS窗口后,然后输入"roo",如果有以下字样:Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
      恭喜你,表示成功安装.spring roo 由于maven 问题,暂时不能在linux环境下使用,正在解决中。

 

命令使用

spring roo提供了非常多的命令工具,常用如下:

    1. help
      帮助。用来显示所以spring roo命令以及使用办法
    2. exit
      退出。退出roo操作环境
    3. biz bundle add (name 参数代表bundle名字.biz bundle 操作必须项目的app/biz目录下使用)
      创建biz bundle。比如:biz bundle add --name user
    4. biz bundle remove (name 参数代表bundle名字)
      删除biz bundle。比如:biz bundle remove --name user(删除功能仅是对parent pom和总pom进行更新,文件夹还是存在的,需自行删除)
    5. synEarPom
      主要用于将主Pom.xml内容同步到assembly下ear/pom.xml中。此命令必须在项目根目录下使用,其他目录下将不能使用
    6. web bundle add (name 参数代表bundle名字.web bundle 操作必须项目的app/web目录下使用)
      创建web 模块 bundle。比如:web bundle add --name user
    7. web bundle remove (name 参数代表bundle名字)
      删除web 模块 bundle。比如:web bundle remove --name user
    8. bundle add(name 参数代表bundle名字)
      相当于同时执行biz bundle add 和 web bundle add,注意该命令要在根目录执行。比如: bundle add --name user
    9. bundle remove(name 参数代表bundle名字)
      相当于同时执行biz bundle remove 和 web bundle remove,注意该命令要在根目录执行。比如: bundle remove --name user
      注意:roo自身还提供了很多其他功能,但结合公司情况暂不能使用。
    10. service bundle add(name 参数代表bundle名字)
      创建common-service-'name' bundle,必须在common/service目录执行。比如:service bundle add --name user
    11. service bundle remove(name 参数代表bundle名字)
      删除common-service-'name' bundle,必须在common/service目录执行。比如:service bundle remove --name user

 ps:请保证roo的执行目录中没有中文,不然会创建失败。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值