Grails(2)Upgrade Groovy and Grails First Step

Grails(2)UpgradeGroovyandGrailsFirstStep

1.Upgradegroovyto1.8.6

downloadthelatestversionherehttp://groovy.codehaus.org/Download

Unzipthefileandaddittopath

GROOVY_HOME=D:\tool\groovy-1.8.6

andpathaddingD:\tool\groovy-1.8.6\bin;

C:\Users\luohua>groovy-v

GroovyVersion:1.8.6JVM:1.7.0_04Vendor:OracleCorporationOS:Windows7

2.Upgradegrailsto2.0.4

downloadthelatestgrailsherehttp://www.grails.org/Download

Unzipthefileandaddittopath

GRAILS_HOME=D:\tool\grails-2.0.4

pathaddingD:\tool\grails-2.0.4\bin;

C:\Users\luohua>grails

Thiswilldownloadsomejarpackages,andthisversion2.0.4,itisdifferentfrom1.xversion.

C:\Users\luohua>grails-version

Grailsversion:2.0.4

3.tryonedemotoverifymyinstallation

>grailscreate-apphellosillycat

>cdhellosillycat

entertheinteractiveconsole

>grails

TABtotip

grails>create-controllerhello

ChangethecontentofHelloController.groovyasfollow:

packagehellosillycat

classHelloController{

defindex(){

render"HelloWorld!"

}

}

Rightnow,wehavetheprojectstructureandwehavethefirstactionHelloController.groovy.Startthewebcontrainer:

grails>run-app

Thiscommandcanexittheapplictionserver.

grails>exit

4.EclipsePlugin

IwilluseSTSandinstallGrailsplugin.Wecanimporttheprojectwejustcreate,andVMwarevFabricServerwillbethewebcontainer.

references:

相关推荐