Skip to content

4. Getting Started

Austin Groovy and Grails User Group edited this page Dec 12, 2013 · 7 revisions

Here is what you need to get started. If you get stuck or need a clarification please post a question on the Austin Groovy and Grails Meetup forum.

  1. Java 1.7 Setup

Download and install Java 1.7 from Oracle. There is an OpenJDK 1.7 that may work but I've had problems in the past with it so let's standardize on Oracle's implementation: Download Oracle Java 1.7

  1. Groovy and Grails Setup

Download Grails 2.3.3 from this link: Grails 2.3.3 and unzip it into your home directory (or wherever you want to install your applications).

Alternatively, if you use Linux, install the GVM tool and use it to download and install Grails. See GVM TOOL for details. Briefly, you can install GVM with the following command:

$ curl -s get.gvmtool.net | bash

Then run this command to install Grails,

$ gvm install grails 2.3.3

  1. Git Command

The source code control system is Git, obviously. It is likely already bundled with your IDE but you should install it anyway as you will occasionally need to run it from the command line. GitHub has some docs on where to get Git for your platform: Set Up Git

Take the time to understand how to use it. See Git Tutorial for more information.

Basically, the commands you need to know are,

git clone

creates a local copy of a repository located on a remote computer.

git add <some-path-to-file>

adds a file to the staging area of the local repo.

git status

shows what changes have been made to your repo and what is ready to be committed.

git commit -m "comment that describes the changes"

commits the changes in the staging area to the local repo.

git push

send the changes in the local repo back up to the remote repo, i.e., the Growler repo on your GitHub account.

  1. Create a GitHub Account

If you have not already done so create an account on GitHub.

  1. Add your SSH Keys to GitHub [Recommended but optional]

A convenient and secure way to push content to GitHub with the Git command is through the SSH protocol. To establish a secure connection between your computer and GitHub you need to generate and install an SSH key for each computer you intend to use. For information how to do this see: Generating and Installing Your SSH Key

  1. Fork the Growler GitHub Repo

From your account on GitHub, navigate to the Growler Project Page, then create your own copy of the Growler project by clicking on the Fork button at the top of the page. You now have an exact replica of the Growler project on your GitHub account. The next step is to clone your copy of Growler onto your computer. Make sure you have the tool git installed and run the following command,

$ git clone [email protected]:<your-userid>/growler.git

replacing <your-userid> with your GitHub userId. You now have a working repo on your computer that you can modify.

  1. Pull Requests

Once you have committed and pushed your changes back to your repo on GitHub you need to send a pull request back to the https://github.com/aggug/growler repo. Do this by clicking on the Pull Requests button on your GitHub Growler project page (see right sidebar) and then on the green New Pull Request button.

  1. Integrated development environments

It is not necessary to use an IDE to write a Grails application but it can make it more convenient. The two most popular ones are IntelliJ IDEA (Ultimate Edition) Idea and GGTS (Eclipse).

After cloning the repo you should run the following command to set up the IDE specific project files:

grails integrate-with <IDE-OPTION>

where <IDE-OPTION> is either,

--eclipse or --intellij

Clone this wiki locally