grails - Grails 3脚手架问题

标签 grails scaffolding

我正在尝试将我的项目从Grails 2.4移植到3.0。没什么:12个域,13个 Controller 和一个服务。
一切正常,除非我尝试包含Scaffolding插件。我从字面上遵循手册here,但语法必须错误。按指定添加插件行:

    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中包括Scaffolding插件的正确语法吗?

编辑:感谢Casey向我指出正确的方向:脚手架插件实际上已经包含在默认的build.gradle中。无论如何,我仍然在每个 Controller 上得到这样的网页:
Error: Page Not Found (404)
Path: /*controllerName*/index

我一直使用与手册相同的语法,在每个 Controller 上声明一个static scaffold = true。为什么我会得到404页面?我的 View 文件夹中确实有index.gsp,error.gsp和notFound.gsp。

最佳答案

看来该文档尚未针对Grails 3.0进行更新。您的build.gradle文件应具有dependencies块,您可以在其中指定依赖项:

dependencies {
    // ...
    runtime "org.grails.plugins:scaffolding"
}

您也可以通过使用Grails 3.0创建一个新应用并 checkout 默认的build.gradle文件来查看此信息。

关于grails - Grails 3脚手架问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29449417/

相关文章:

java - IntelliJ IDEA 构建未完成的 Grails war

grails: "business controller"加上一个管理脚手架=true Controller

css - 自举网格偏移

chalice 2.5 : "Another unnamed CacheManager already exists in the same VM" when using multiple datasources

grails - 自定义错误消息无法在带有grails的gorm中使用

grails 动态脚手架 - 跳过一个字段以在 View 中渲染

ruby-on-rails - 再生脚手架

ruby-on-rails - 添加新列后更新脚手架 View

asp.net-mvc - EF 4.5 Code First 复合键的 MVC 脚手架错误

jquery - 从主提交表单