Grails(2)Upgrade Groovy and Grails First Step

Grails(2)Upgrade Groovy and Grails First Step

1. Upgrade groovy to 1.8.6
download the latest version here http://groovy.codehaus.org/Download
Unzip the file and add it to path
GROOVY_HOME=D:\tool\groovy-1.8.6
and path adding D:\tool\groovy-1.8.6\bin;

C:\Users\luohua>groovy -v
Groovy Version: 1.8.6 JVM: 1.7.0_04 Vendor: Oracle Corporation OS: Windows 7

2. Upgrade grails to 2.0.4
download the latest grails here http://www.grails.org/Download

Unzip the file and add it to path
GRAILS_HOME = D:\tool\grails-2.0.4
path adding D:\tool\grails-2.0.4\bin;

C:\Users\luohua>grails
This will download some jar packages, and this version 2.0.4, it is different from 1.x version.
C:\Users\luohua>grails -version
Grails version: 2.0.4

3. try one demo to verify my installation
>grails create-app hellosillycat
>cd hellosillycat
enter the interactive console
>grails
TAB to tip
grails>create-controller hello

Change the content of HelloController.groovy as follow:
package hellosillycat
class HelloController {
def index() {
        render "Hello World!"
    }
}

Right now, we have the project structure and we have the first action HelloController.groovy. Start the web contrainer:
grails>run-app

This command can exit the appliction server.
grails>exit

4. Eclipse Plugin
I will use STS and install Grails plugin. We can import the project we just create, and VMware vFabric Server will be the web container.


references:
http://sillycat.iteye.com/blog/1137079
http://sillycat.iteye.com/blog/562774
http://sillycat.iteye.com/blog/562775


你可能感兴趣的:(groovy)