Search This Blog

Saturday, September 1, 2012

Grails & Groovy Development - Part-1

Grails is a web application framework based on Groovy language. Groovy and Grails run on top of the JVM.  Grails is basically a dynamic web development framework based on the Convention over configuration principle.  Grails work based on conventions and reduces development time with the help of development tools to generate lot of boiler-plate code. 


Installing Grails (Mac OSX Lion 10.7.4):

1. Download the latest version of grails from grails.org ( I downloaded Grails - 2.1 version) 
2. Copy it to some directory like /Users/mmm/Applications/
3. Set the GRAILS_HOME  and PATH environment variables
  •       export GRAILS_HOME=/Users/mmm/Applications/grails
  •       export PATH=$GRAILS_HOME/bin:$PATH
4.  Now close the terminal and re-open and you should be all set to create some test grails web apps. 
5. Grails come with in-built tomcat server. Try create-app, create-controller, and run-app commands. 
    Refer to the Grails documentation page for more details: Grails documentation




Development using Spring Tool Suite Eclipse IDE: 

1. Download the Eclipse Spring Tool Suite from here: http://www.springsource.org/downloads/sts-ggts
2. Extract the archive file to a folder and copy it to a location where you want to place the Spring Tool suite libraries.
3.  Locate the STS executable icon inside the folder and click on it.
4. It should open the Eclipse like IDE.
5. You can create new Grails project in the following way.  It's very similar to Eclipse Java based web development.  Refer to here for more documentation: Grails & STS