我試圖將我的項目從Grails 2.4移植到3.0。沒什麼奇特的:12個域名,13個控制器和一項服務。 一切工作正常,除了當我嘗試包括腳手架插件。我字面上按照手冊here,但語法必須是錯誤的。添加插件行規定:Grails 3腳手架問題
plugins {
…
compile ":scaffolding:2.0.0"
…
}
導致這個:
BUILD FAILED
Total time: 1.559 secs
| Error Error initializing classpath: startup failed:
build file 'E:\GrailsIdeaProjects\HcaServer\build.gradle': 17: only id(String) method calls allowed in plugins {} script block
See http://gradle.org/docs/2.3/userguide/plugins.html#sec:plugins_block for information on the plugins {} block
@ line 17, column 5.
compile ":scaffolding:2.0.0"
^
1 error
(Use --stacktrace to see the full trace)
有人知道正確的語法,包括Grails的3腳手架插件?
編輯:感謝凱西指出我在正確的方向:腳手架插件實際上已經包含在默認的build.gradle。不管怎樣,我還是讓每一個控制器上像這樣的網頁:
Error: Page Not Found (404)
Path: /*controllerName*/index
我一直在使用相同的語法按說明書,宣佈每個控制器上的static scaffold = true
。爲什麼我會得到一個404頁面?我在我的視圖文件夾中有index.gsp,error.gsp和notFound.gsp。