Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Spring Roo 1.1 Cookbook

You're reading from   Spring Roo 1.1 Cookbook Over 60 recipes to help you speed up the development of your Java web applications using the Spring Roo development tool

Arrow left icon
Product type Paperback
Published in Sep 2011
Publisher Packt
ISBN-13 9781849514583
Length 460 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (14) Chapters Close

Spring Roo 1.1 Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with Spring Roo FREE CHAPTER 2. Persisting Objects Using JPA 3. Advanced JPA Support in Spring Roo 4. Web Application Development with Spring Web MVC 5. Web Application Development with GWT, Flex, and Spring Web Flow 6. Emailing, Messaging, Spring Security, Solr, and GAE 7. Developing Add-ons and Removing Roo from Projects Index

Setting up Roo


The first thing that you need to do to get started with using Spring Roo is to set up the Roo tool on your laptop or desktop.

In this recipe, we will look at how you can install Spring Roo and verify that it's ready to use.

Tip

What do I need to learn to effectively use Spring Roo?

If you are an experienced Java enterprise developer, then you hardly need to learn anything new to use Spring Roo. If you know how AspectJ ITDs (Inter-type Declarations) work, then it will be helpful to understand what Spring Roo does behind the scenes. As you go through the various recipes in this book, you will find enough details on how Spring Roo makes use of AspectJ ITDs.

Getting ready

As you are going to install Spring Roo, you first need to download Spring Roo ZIP archive from the official home page of Spring Roo(http://www.springsource.org/roo/start). Also, ensure that you have the following software installed on your machine:

How to do it...

To install Spring Roo, all you need to do is to follow the given steps:

  1. Unzip the downloaded Spring Roo ZIP archive into a directory. Once you have unzipped Spring Roo ZIP file, you will see the directory structure (excluding the cache directory) as shown in the following screenshot:

  2. Set the JAVA_HOME environment variable to point to the Java SE installation directory.

  3. Set the ROO_HOME environment variable to point to the Roo installation directory.

  4. If you are using Windows, add the ROO_HOME/bin directory to the PATH environment variable. If you are using Linux or Mac OS X, then create a symbolic link to the ROO_HOME/bin/roo.sh shell script.

  5. Roo installation isn't complete unless you verify it. So, create a ch01-recipe sub-directory in the C:\roo-cookbbook directory, open command prompt, and go to the ch01-recipe directory. Now, execute the roo.bat batch file, as shown in the following commands:

    Tip

    Downloading the example code

    You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    C:\>cd roo-cookbbook
    C:\roo-cookbbook>cd ch01-recipe
    C:\roo-cookbbook\ch01-recipe>roo
        ____  ____  ____
       / __ \/ __ \/ __ \
      / /_/ / / / / / / /
     / _, _/ /_/ / /_/ /
    /_/ |_|\____/\____/    1.1.1.RELEASE [rev 156ccd6]
    
    
    Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
    ..
    roo>
    
  6. If you see the output as shown, it means you have successfully installed Spring Roo. You will notice that when you execute roo.bat or roo.sh, the command prompt changes to roo>. You are now ready to play with Spring Roo.

How it works...

Spring Roo is built on top of Apache Felix (http://felix.apache.org/site/index.html) OSGi container, which promotes modularity and dynamic assembly of applications. The bundle directory contains OSGi bundles that form part of Spring Roo release. These bundles provide core services required by Roo and add-ons that support code generation. When you first start Spring Roo by executing Roo batch file or shell script, then these bundles are installed and copied into the cache directory of your Spring Roo installation.

There's more...

Spring Roo comes with certain core services and base add-ons that are part of Spring Roo distribution. Core services like the Roo shell, file system monitor, bootstrap, and so on, provide the necessary infrastructure for the add-ons to perform their intended responsibility. Add-ons are at the heart of Spring Roo and they provide the code generation functionality. For instance, the e-mail add-on adds e-mail support and the JPA (Java Persistence API) add-on helps with setting up a JPA provider, creating JPA entities, their relationships, and so on.

As Roo add-ons are OSGi compliant, you can additionally create a custom add-on or download a third-party add-on and install it as part of your Spring Roo installation to extend Roo's functionality.

You have been reading a chapter from
Spring Roo 1.1 Cookbook
Published in: Sep 2011
Publisher: Packt
ISBN-13: 9781849514583
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image