Grails(1)Build ENV on MAC

Grails(1)Build ENV on MAC
1. Install the Latest Groovy and Grails
1.1 install the latest groovy on mac
>sudo port install groovy
>groovy -v
Groovy Version: 2.0.0 JVM: 1.6.0_37 Vendor: Apple Inc. OS: Mac OS X

1.2 Install the latest grails on mac
>sudo port install grails
>grails -version
Grails version: 2.1.0


The grails home package is here
/opt/local/share/java/grails

2. Prepare the IDE
I will use STS, and I install groovy plugin and grails plugin and scala plugin there.
I do not know why there is no scala project in my views. So I try to install another plugin from this URL
http://dist.springsource.com/release/TOOLS/third-party/scala/e3.7

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

Then I can visit the URL http://carl.digby.com:8080/hellosillycat/hello/index to see my controller.s
This command can exit the appliction server.
grails>exit

And the web container of STS is also a very useful tool - VMware vFabric tc Server Developer Edition v2.7

references:
http://sillycat.iteye.com/blog/1137079
http://sillycat.iteye.com/blog/1567050
http://sillycat.iteye.com/blog/1567542

http://sillycat.iteye.com/blog/1074642
http://sillycat.iteye.com/blog/1058726

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

http://www.grailsexample.net/installing-a-grails-development-environment-on-os-x/

你可能感兴趣的:(grails)