使用Eclipse + flex plugin 構建開發環境:
1.安裝3.2或者以上版本的Eclipse
2、安裝Eclipse的Flex Plugin
3、安裝Grails 以及 Eclipse的Groovy Plugin(可選)
具體請參考其官方站點的安裝說明 http://grails.org/Installation
以及 http://www.grails.org/Eclipse+IDE+Integration
4、創建Grails項目
pro>grails create-app hello
5、安裝Grails的Flex Plugin
pro/sample>grails install-plugin flex
第一次安裝會比較慢,因為要從其官方站點下載該插件,以后就直接從本地安裝了。
6、導入Grails創建的project,點擊Finish

7.選中project,點擊右鍵,選中Add Flex project Nature, 設置Application server type為"None",點擊Next
8.接下來,在該project的web-app下新建文件夾bin,設置Output folder 為web-app\bin,點擊Finish
9.在grails-app下新建文件夾flex,右鍵點擊project->Properties->Flex Build path, 設置
Main soure folder 為grails-app\flex
Output folder 為web-app\bin
Outout folder URL為 http://localhost:8080/hello/bin
10.設置run參數,new一個Flex Application,設置URL or path to launch的路徑
Debug: http://localhost:8080/hello/bin/hello.html
Profile: http://localhost:8080/hello/bin/hello.html
Run: http://localhost:8080/hello/bin/hello.html
注意: 如果提示html-templdate無法創建,則設置Flex Compiler,先勾掉"Generate HTML wrapper file",再選中它
然后grails run-app啟動server端,運行Flex 工程啟動客戶端即可。