Spring Roo 实站( 一 )部署安装 & 第一个示例程序

2023-11-09

一:安装

注:可以参与官网spring-roo:

static.springsource.org/spring-roo/reference/html/intro.html#intro-exploring-sampleROO_OPTS

http://static.springsource.org/spring-roo/reference/html/intro.html#intro-exploring-sample

http://static.springsource.org/spring-roo/reference/html/beginning.html

http://www.springsource.org/samples


1:于http://www.springsource.org/download/community 下载 spring-roo-1.2.4.RELEASE.zip安装包

2:解压后,将解压后路径(E:\知识积累\Spring3框架研究\5 spring-roo-1.2.4\spring-roo-1.2.4.RELEASE\bin )配置到系统环境变量Path里,执行cmd 进入 bin/ ,执行

$ mkdir roo-test
$ cd roo-test
$ roo quit
出现roo logo图标算安装成功,如:
 


3 可选择ROO_OPTS 配置

At present the only configuration settings available is roo.bright. This causes foreground messages in the shell to be displayed with brighter colors. This is potentially useful if your background color is light (e.g. white). You can set the variable using the following commands:

$ export ROO_OPTS="-Droo.bright=true"                   // Linux or Apple
$ set ROO_OPTS="-Droo.bright=true"                      // Windows users


二:ten-minutes 程序示例 

1:创建程序目录ten-minutes(存放到:E:\知识积累\Spring3框架研究\5 spring-roo-1.2.4\spring-roo-1.2.4.RELEASE)

cmd:cd e:

cmd:mkdir ten-minutes

cmd:cd ten-minutes

cmd:roo

进入roo   shell 命令

2 创建相关程序部分配置文件和类包

roo> project --topLevelPackage com.tenminutes
Created /home/balex/ten-minutes/pom.xml
Created SRC_MAIN_JAVA
Created SRC_MAIN_RESOURCES
Created SRC_TEST_JAVA
Created SRC_TEST_RESOURCES
Created SRC_MAIN_WEBAPP
Created SRC_MAIN_RESOURCES/META-INF/spring
Created SRC_MAIN_RESOURCES/META-INF/spring/applicationContext.xml

3 按hint提示生成数据库文件(目前数据库使用HYPERSONIC_IN_MEMORY,即将数据存入内存中)

roo> hint
Roo requires the installation of a JPA provider and associated database.

Type 'jpa setup' and then hit TAB three times.
We suggest you type 'H' then TAB to complete "HIBERNATE".
After the --provider, press TAB twice for database choices.
For testing purposes, type (or TAB) HYPERSONIC_IN_MEMORY.
If you press TAB again, you'll see there are no more options.
As such, you're ready to press ENTER to execute the command.

即:
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY

4 其它步骤

roo> hint
roo> entity jpa --class ~.Timer --testAutomatically
roo> hint
roo> field string --fieldName message --notNull
roo> hint web mvc
roo> web mvc setup
roo> web mvc all --package ~.web
roo> selenium test --controller ~.web.TimerController
roo> perform tests
roo> perform package
roo> perform eclipse
roo> quit
$ mvn tomcat:run


5 后续

The "perform" commands could have been easily undertaken from the command prompt using "mvn" instead. We just did them from within Roo to benefit from TAB completion. You could have also skipped the "perform eclipse" command if you are using the m2eclipse plugin. If you are using SpringSource Tool Suite (STS), it automatically includes m2eclipse and as such you do not need to use the "perform eclipse" command. Indeed if you're an STS user, you could have started your Roo project right from within the IDE by selecting the File > New > Spring Roo menu option and completing the steps. In that case a Roo Shell view will open within STS and from there you can enter the remaining commands.

Now that you've loaded Tomcat, let's run the Selenium tests. You can do this by loading a new command window, changing into the ten-minutes directory, and then executingmvn selenium:selenese. You should see your FireFox web browser execute the generated Selenium tests. You can also visit your new web application athttp://localhost:8080/tenminutes, which should look similar to the picture below.


6  命令说明

  • roo> hint ROO会提示下一步该做啥
  • roo> project --topLevelPackage 创建项目
  • roo> persistence setup --providerHIBERNATE --database 选择需要使用的JPA和database
  • roo> entity --class ~.domain.Timer --testAutomatically 新建Entity
  • roo> field string --fieldName message --notNull 新增属性
  • roo> controller all --package ~.web 对所有实体对象建立控制器
  • roo> selenium test --controller ~.web.TimerController 为controller建立selenium的自动化web测试脚本
  • roo> perform tests 执行test
  • roo> perform package 打包
  • roo> perform eclipse 将项目转化为Eclipse的项目
  • roo> quit 退出Roo环境
mvn tomcat:run 发布应用到Tomcat,并启动Tomcat Server.



本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Spring Roo 实站( 一 )部署安装 & 第一个示例程序 的相关文章

随机推荐

  • Linux蓝牙系统(3) Linux 命令

    Linux蓝牙系统 3 Linux 命令 2010 09 27 10 45 44 分类 LINUX Andrew Haung bluedrum 163 com 一 Linux对于蓝牙的支持 参见如下协议图 在HCI界面之上需要软件来实现 1
  • ctf.show web6 sql注入过滤了空格

    ctf show web6 sql注入过滤了空格 开始的页面 是一个登录的页面 随便输入用户名和密码 没有报错之类的 就把账户名和密码都清空了 那就来burpsuit抓包 先用个万能密码 or 1 1
  • 加密 scrapy

    js常见的加密方式 加密在前端开发和爬虫中是经常遇见的 掌握了加密算法且可以将加密的密文进行解密破解的 也是你从一个编程小白到大神级别质的一个飞跃 且加密算法的熟练和剖析也是很有助于帮助我们实现高效的js逆向 下述只把我们常用的加密方法进行
  • Windows服务器怎么才能长时间保持远程桌面不自动断开

    服务器在通过mstsc远程连接后 如果长时间不操作 会自动断开 这种是Windows系统的远程保护机制 但是对于操作服务器来说 这种断开可能会影响到工作效率 那么如何设置才能一直保持连接状态呢 用过Windows自带的远程桌面连接服务可能都
  • Please make sure you have the correct access rights

    使用git克隆 拉取 提交的时候 发现不能操作 提示如下 Please make sure you have the correct access rights fatal Could not read from remote reposi
  • QTP工具简单操作使用说明

    简介 QTP是QuickTest Professional 的简称 是一种自动化测试工具 使用QTP的目的是用它来执行重复的手动测试 主要用于回归测试和测试同一软件的新版本 版本迭代 启动QuickTest 第一次启动QuickTest时
  • go的channel实现归并排序

    func main ch1 create int 1 3 6 待排序的管道1 ch2 create int 2 5 9 待排序的管道2 ch merge ch1 ch2 for c range ch fmt Println c for ru
  • java概述,发展历程

    1 java概述 首先对于刚刚接触java的小白来说 可能连java是什么 为什么叫这么名字都不知道 其实 Java语言是有个曾用名的 叫Oak 而且起这个名字的时候也是很随心的 只是因为看到了窗口外的一颗橡树 歌词 只是因为面向窗外多看了
  • python 合并不同文件夹下名称相同的文件

    转载 https blog csdn net qq 42769683 article details 104565285 utm source app app version 4 10 0 code app 1562916241 uLink
  • 3D 人体姿态估计简述[转]

    转自 3D 人体姿态估计简述 知乎 0 前言 3D Human Pose Estimation 以下简称 3D HPE 的目标是在三维空间中估计人体关键点的位置 3D HPE 的应用非常广泛 包括人机交互 运动分析 康复训练等 它也可以为其
  • 使用Python的Cufflinks库创建三维散点图

    使用Python的Cufflinks库创建三维散点图 在数据可视化中 三维散点图是一种常用的图形展示方式 如果您正在寻找一种方便易用的数据可视化工具来创建三维散点图 那么Cufflinks就是一个不错的选择 Cufflinks是一个基于pl
  • 恕我直言,自从用完Gradle后,有点嫌弃Maven了!速度贼快!

    点击上方蓝色字体 选择 标星公众号 优质文章 第一时间送达 99套Java企业级实战项目 4000G架构师资料 作者 乐百川 点击阅读原文前往 授权转载自 toutiao com i6824937779193971207 相信使用Java的
  • Spring 基于ApplicationEvent、ApplicationEventPublisher、ApplicationListener的事件监听、发布记录

    1 概述 事件发布和订阅具体流程 1 具体要发布的事件 事件中携带发送的数据 2 发送事件 3 监听器 监听发布的事件 获取事件的携带数据 执行业务逻辑 发布 事件作为参数 事件 监听 事件作为参数 例如 使用切面记录系统日志 发送相同类型
  • oracle 9i在线重定义,Oracle 9i中表的在线重定义(转)

    今天遇到要把数据库中的某张表改成分区表 而且该表在别的地方还有其他的注册信息 如果自己手工建一个分区表的替代该表的话 那就得要手工地去执行该表在其他地方的注册 所以不想删除该表再手工创建同名的分区表 想到了Oracle 9i中可以使用在线重
  • gitee上传代码方法(命令)

    第一次上传 创建一个gitee仓库 在 我的电脑 里找到你要上传的文件的位置 在地址栏输入cmd 回车 输入git init 输入git add 输入git commit m 备注信息可更改 输入 git remote add origin
  • C语言中的清屏函数(自己编写)

    在csdn论坛里看到这样一个问题 如何在c语言命令提示下清除屏幕 感兴趣 随查之 有解 include
  • 蓝帽杯半决赛2022

    手机取证 1 iPhone手机的iBoot固件版本号 答案参考格式 iBoot 1 1 1 直接通过盘古石取证 打开 取证大师和火眼不知道为什么都无法提取这个 手机取证 2 该手机制作完备份UTC 8的时间 非提取时间 答案参考格式 200
  • 修炼离线:(五)hbase映射表插入hive

    一 创建hive表 sql drop table if exists ods odsyyy create table if not exists ods odsfff row id string comment 行记录唯一ID 对应ROW
  • Makefile入门二、理解$@、$^和$<

    文章目录 一 理解 lt 的含义 二 举例 三 简提Makefile中打印日志信息 前面简单记录了一下Makefile中helloworld的用法 这次来理解一些 lt 的含义 一 理解 lt 的含义 Makefile中 格式为这样的 ta
  • Spring Roo 实站( 一 )部署安装 & 第一个示例程序

    一 安装 注 可以参与官网spring roo static springsource org spring roo reference html intro html intro exploring sampleROO OPTS http