Spring Roo 命令行说明

简介: 参考文档:http://projects.spring.io/spring-roo/#running-from-shell$ roo.sh _ ___ ...

参考文档:http://projects.spring.io/spring-roo/#running-from-shell

$ roo.sh 
                _                               
 ___ _ __  _ __(_)_ __   __ _   _ __ ___   ___  
/ __| '_ \| '__| | '_ \ / _` | | '__/ _ \ / _ \ 
\__ \ |_) | |  | | | | | (_| | | | | (_) | (_) |
|___/ .__/|_|  |_|_| |_|\__, | |_|  \___/ \___/ 
    |_|                 |___/          2.0.0.RC2

Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
roo> 
roo> 
roo> help

COMMAND INDEX 

!g                  Passes a command directly through to the Felix shell
                    infrastructure.

!os                 Allows execution of operating system (OS) commands. Ex.:
                    `!os mkdir test_dir`

*/                  End of block comment

/*                  Start of block comment

//                  Inline comment markers (start of line only)

;                   Inline comment markers (start of line only)

addon create advanced 
                    Create a new advanced add-on for Spring Roo (commands + 
                    operations + metadata + trigger annotation + dependencies).

addon create i18n   Create a new internationalization add-on for Spring Roo,
                    with a new language.
                    with a new language.Created add-on can be installed later 
                    into a project for localizing the project to that new 
                    language.

addon create simple Create a new simple add-on for Spring Roo (commands +
                    operations).

addon create suite  Create a new Spring Roo Addon Suite for Spring Roo (two
                    sample addons + repository + suite generator).

addon create wrapper 
                    Create a new add-on for Spring Roo which wraps a maven 
                    artifact to create a OSGi compliant bundle.

addon development mode 
                    Switches the system into development mode, which enables 
                    add-on development commands and shows greater diagnostic 
                    information.

addon info bundle   Provide information about a specific Spring Roo Add-on from
                    installed repositories.

addon install bundle 
                    Install Spring Roo Add-on from installed repositories.

addon install url   Install Spring Roo Add-on using an URL.

addon list          List all installed addons.

addon remove        Removes an installed Spring Roo Add-on.

addon repository add 
                    Adds a new OBR Repository to ROO Shell.

addon repository introspect 
                    Introspects all installed OBR Repositories and list all 
                    their addons.

addon repository list 
                    Lists installed OBR Repositories.

addon repository remove 
                    Removes an existing OBR Repository from ROO Shell.

addon search        Search all known Spring Roo Add-ons from installed
                    repositories.

addon suite install name 
                    Installs some 'Roo Addon Suite' from installed OBR 
                    Repository.

addon suite install url 
                    Installs some 'Roo Addon Suite' from URL.

addon suite list    Lists all installed 'Roo Addon Suite'. If you want to list
                    all available 'Roo Addon Suites' on Repository, use 
                    --repository parameter.

addon suite start   Starts some installed 'Roo Addon Suite'. By default, an
                    installed 'Roo Addon Suite' is started automatically.

addon suite stop    Stops some started 'Roo Addon Suite'.

addon suite uninstall 
                    Uninstalls some installed 'Roo Addon Suite'.

backup              Backups your project to a zip file located in root
                    directory.

cache setup         Installs support for using intermediate memory in generated
                    project by using Spring Cache abstraction. Users can specify
                    different providers to use for managing it.

class               Creates a new Java class source file in any project path

constructor         Creates a class constructor.

dto                 Creates a new DTO (Data Transfer Object) class in the
                    directory _src/main/java_ of the selected project module (if
                    any) with @RooDTO annotation.

email receiver setup 
                    Installs a Spring JavaMailReceiver in your project.

email sender setup  Install a Spring JavaMailSender in your project

embeddable          Creates a new Java class source file with the JPA
                    `@Embeddable` annotation in the directory _src/main/java_ of
                    the selected project module (if any).

entity jpa          Creates a new JPA persistent entity in the directory
                    _src/main/java_ of the selected project module (if any) with
                    `@RooEntity` annotation.

entity projection   Creates new projection classes from entities in the
                    directory _src/main/java_ of the selected project module (if
                    any) annotated with `@RooEntityProjection`. Transient, 
                    static and entity collection fields are not valid for 
                    projections.

enum constant       Inserts a new enum constant into an enum class.

enum type           Creates a new Java enum source file in any project path.

equals              Add `equals()` and `hashCode()` methods to a class.

exit                Waits until all metadata and files are refreshed and
                    updated, then exits the shell. You can also use `exit` 
                    command.

field boolean       Adds a private boolean field to an existing Java source
                    file.

field date          Adds a private date field to an existing Java source file.

field embedded      Adds a private `@Embedded` field to an existing Java source
                    file. This command is only available for entities annotated 
                    with `@RooJpaEntity` (Roo JPA entities). Therefore, you 
                    should focus the desired entity in the Roo Shell to make 
                    this command available.

field enum          Adds a private enum field to an existing Java source file.
                    The field type must be a Java enum type.

field file          Adds a byte array field for storing uploaded file contents.

field list          Adds a private `List` field to an existing Java source file,
                    representing (always) a bidirectional relation with other 
                    entity. Therefore, this command will also add a field on the
                    other side of the relation (the owner side, with `mappedBy` 
                    attribute), which will be a `List` field for 'many-to-many' 
                    relations, or a *not* `Collection` field for a 'one-to-many'
                    relation. All added fields will have the needed JPA 
                    annotations to properly manage bidirectional relations.This 
                    command is only available for entities annotated with 
                    `@RooJpaEntity` (Roo JPA entities). Therefore, you should 
                    focus the desired entity in the Roo Shell to make this 
                    command available.

field number        Adds a private numeric field to an existing Java source
                    file. User can choose the field type between a wide range of
                    numeric types.

field other         Inserts a private field into the specified file. User can
                    choose a custom type for the field by specifying its fully 
                    qualified name.

field reference     Adds a private reference field, representing (always) a
                    bidirectional 'one-to-one' relation, to an existing Java 
                    source file. Therefore, this command will add as well a 
                    'one-to-one' field on the other side of the relation. This 
                    command is only available for entities annotated with 
                    `@RooJpaEntity`, so you should focus the desired entity in 
                    the Roo Shell to make this command available.

field set           Adds a private `Set` field to an existing Java source file,
                    representing (always) a bidirectional relation with other 
                    entity. Therefore, this command will also add a field on the
                    other side of the relation (the owner side, with `mappedBy` 
                    attribute), which will be a `Set` field for 'many-to-many' 
                    relations, or a *not* `Collection` field for a 'one-to-many'
                    relation. All added fields will have the needed JPA 
                    annotations to properly manage bidirectional relations. This
                    command is only available for entities annotated with 
                    `@RooJpaEntity` (Roo JPA entities). Therefore, you should 
                    focus the desired entity in the Roo Shell to make this 
                    command available.

field string        Adds a private String field to an existing Java source file.

finder add          Installs a finder in the given target (must be an entity).
                    This command needs an existing repository for the target 
                    entity, you can create it with `repository jpa` command. The
                    finder will be added to targeted entity associated 
                    repository and associated service if exists or when it will 
                    be created.

focus               Changes Roo Shell focus to a different type in the project.

help                Shows a summary of all Spring Roo commands.

hint                Provides step-by-step hints and context-sensitive guidance.

interface           Creates a new Java interface source file in any project
                    path.

jms receiver        Creates an JMS receiver.

jms sender          Creates an JMS sender.

jpa audit add       Adds support for auditing a JPA entity. This will add JPA
                    and Spring listeners to this entity to record the entity 
                    changes.

jpa audit setup     Installs audit support into your project, preparing it to
                    audit entity changes.

jpa setup           Installs or updates a JPA persistence provider in your
                    project. User can execute this command for diferent profiles
                    with different persistence configurations.

metadata cache      Shows detailed metadata for the indicated type.

metadata for id     Shows detailed information about the metadata item.

metadata for module Shows the ProjectMetadata for the indicated project module.

metadata for type   Shows detailed metadata for the indicated type.

metadata status     Shows metadata statistics of the current project.

metadata trace      Traces metadata event delivery notifications.

module create       Creates a new Maven module in current *multimodule* project.

module focus        Changes Roo Shell focus to a different project module, when
                    in a multimodule project.

process manager debug 
                    Indicates if process manager debugging is desired. It is 
                    only available if 'addon development mode' is true.

project scan now    Performs a manual file system scan, calling thread monitors
                    and checking that all files are updated.

project scan speed  Changes the time inteval between file system scans.

project scan status Displays file system scanning information such as the time
                    lasted for last scan and scanning frequency.

project setup       Creates a new Maven project.

property add        Adds or updates a particular property from application
                    config properties file.

property list       Lists all properties from an application config properties
                    file.

property remove     Removes a particular property from application config
                    properties file.

push-in             Allows to push-in elements declared in the ITDs to its .java
                    files. You could specify `--all` option to apply push-in on 
                    every component of generated project, or you could define 
                    any package, class or method to apply push-in, combining 
                    them.

quit                Waits until all metadata and files are refreshed and
                    updated, then exits the shell. You can also use `exit` 
                    command.

reference guide     Writes the reference guide XML fragments (in DocBook format)
                    into the current working directory. It is only available if 
                    'development mode' is `true`.

repository jpa      Generates new Spring Data repository for specified entity or
                    for all entities in generated project.

script              Parses the specified resource file and executes its Roo
                    commands. You can as well execute _*.roo_ example scripts in
                    the Roo classpath. Ex.: `script --file clinic.roo`.

security authorize  Includes `@PreAuthorize` annotation to an specific method
                    for controlling access to its invocation.

security filtering  Include `@PreFilter`/`@PostFilter` annotation to an specific
                    method to filter results of a method invocation based on an 
                    expression.

security setup      Install Spring Security into your project.

service             Creates new service interface and its implementation related
                    to an entity, or for all the entities in generated project, 
                    with some basic management methods by using Spring Data 
                    repository methods.

settings add        Adds or updates a Roo project setting, which can modify the
                    configuration of some commands acting in the current 
                    project. These settings are located in 
                    _[PROJECT-ROOT]/.roo/config/project.properties_.

settings list       Lists all settings added into Roo project configuration.
                    These settings are located in 
                    _[PROJECT-ROOT]/.roo/config/project.properties_.

settings remove     Removes a specific setting from Roo project configuration.
                    Use 'settings list' to see the Roo settings added to the 
                    project.

system properties   Shows the shell's properties such as if 'addon development
                    mode' is enabled, JVM version, file encoding...

test integration    Creates a new integration test class for the specified
                    class. The generated test class will contain a basic 
                    structure and the necessary testing components.

test unit           Creates a unit test class with a basic structure and with
                    the necessary testing components, for the specified class.

version             Displays Roo Shell banner and version.

web flow            Installs a Spring Web Flow into your project.

web mvc controller  Generates new `@RooController's` in the directory
                    _src/main/java_ of the selected project module (if any). The
                    generated controllers should manage specific entities in the
                    project.

web mvc detail      Generates new `@RooController` for relation fields which
                    detail wants to be managed. It must be a `@OneToMany` field.
                    Generated controllers will have `@RooDetail` with info about
                    the parent entity and the parent views where the detail will
                    be displayed.

web mvc exception handler 
                    Adds methods to handle an application exception in a 
                    specified controller or a class annotated with 
                    `@ControllerAdvice`.

web mvc finder      Publishes existing finders to web layer, generating
                    controllers and additional views for them. It adds 
                    `@RooWebFinder` annotation to MVC controller type.

web mvc language    Installs new language in generated project views. Also,
                    could be used to specify the default language of the 
                    project.

web mvc setup       Includes Spring MVC configuration on generated project.
                    Needed for several MVC related commands.

web mvc templates setup 
                    Includes view generation templates on current project. Will 
                    allow developers to customize view generation by modifying 
                    the templates from _[PROJECT-ROOT]/.roo/templates/..._

web mvc view setup  Includes all necessary resources of provided response type
                    on generated project. This response type will be needed by 
                    `web mvc controller`, `web mvc detail` and `web mvc 
                    templates setup` commands.

ws client           Generates a new Web Service client by the provided WSDL
                    file.

ws endpoint         Generates a new Service Endpoint Interface (SEI) and its
                    implementation.


** Type 'hint' (without the quotes) and hit ENTER for step-by-step guidance **

roo> hint
Welcome to Roo! We hope you enjoy your stay!

Before you can use many features of Roo, you need to start a new project.

To do this, type 'project setup' (without the quotes) and then hit TAB.

Enter a --topLevelPackage like 'com.mycompany.projectname' (no quotes).
When you've finished completing your --topLevelPackage, press ENTER.
Your new project will then be created in the current working directory.

Note that Roo frequently allows the use of TAB, so press TAB regularly.
Once your project is created, type 'hint' and ENTER for the next suggestion.
You're also welcome to visit http://stackoverflow.com/questions/tagged/spring-roo
for Roo help.
roo> 
相关文章
|
7月前
|
Java 数据库连接 Spring
Spring Boot命令行启动添加参数
Spring Boot命令行启动添加参数
243 0
|
Web App开发 前端开发 安全
Spring Roo 简介
一直以来,Java/Spring开发被认为是笨重的代表,无法快速生成项目原型和骨架。所以,Spring推出了Spring Roo这个项目,帮助我们快速生成项目原型。
1316 0
|
前端开发 安全 Java
|
前端开发 Java Spring
《精通Spring MVC 4》——1.4 命令行方式简介
本节书摘来自异步社区《精通Spring MVC 4》一书中的第1章,第1.4节,作者:【美】Geoffroy Warin著,更多章节内容可以访问云栖社区“异步社区”公众号查看
1614 0
|
前端开发 Java 测试技术
Spring Roo开发初评
Spring Roo开发初评     我们广泛使用Spring MVC 和 SpringSource 的其他产品, 来 构建企业Web 应用。 作为一家外包 公司 ,我们在前端开发严重地依赖于 Flex,我们对 Spring-BlazeDS的整合总是得心应手。
850 0
|
Java Spring 开发工具
Spring Roo 2 使用分析
上一篇对Roo进行了简要的介绍,本节结合参考文档对其使用进行简要分析 数据实体和关系设计 命令执行后,生成一系列的: 实体名_Roo_***.aj的文件,这些文件通过STS编译进输出的包中 Entity A.
1022 0
|
JavaScript 前端开发 Java
Spring Roo 3 实例训练[同时使用Javascript库dojo和jQuery并使用Rest服务]
前两篇讲解了ROO的一些基本知识,这篇来个实例看看整个的开发过程。 首先进入roo命令行,执行如下的脚本[建工程和必要的设置] project --topLevelPackage lesson persistence setup --provider HIBERNATE --database ...
1011 0
|
前端开发 Java 测试技术
Spring Roo开发初评
版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/5789148 Spring Roo开发初评     我们广泛使用Spring MVC 和 SpringSource 的其他产品, 来 构建企业Web 应用。
978 0
|
2月前
|
人工智能 自然语言处理 前端开发
SpringBoot + 通义千问 + 自定义React组件:支持EventStream数据解析的技术实践
【10月更文挑战第7天】在现代Web开发中,集成多种技术栈以实现复杂的功能需求已成为常态。本文将详细介绍如何使用SpringBoot作为后端框架,结合阿里巴巴的通义千问(一个强大的自然语言处理服务),并通过自定义React组件来支持服务器发送事件(SSE, Server-Sent Events)的EventStream数据解析。这一组合不仅能够实现高效的实时通信,还能利用AI技术提升用户体验。
239 2
|
1天前
|
Java 数据库连接 Maven
最新版 | 深入剖析SpringBoot3源码——分析自动装配原理(面试常考)
自动装配是现在面试中常考的一道面试题。本文基于最新的 SpringBoot 3.3.3 版本的源码来分析自动装配的原理,并在文未说明了SpringBoot2和SpringBoot3的自动装配源码中区别,以及面试回答的拿分核心话术。
最新版 | 深入剖析SpringBoot3源码——分析自动装配原理(面试常考)