我使用grails 2.4.4
我在我的BuildConfig中添加了依赖项:
dependencies {
test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
compile "org.grails.plugins:scaffolding:2.1.2"
}并添加插件:
plugins {
build ":tomcat:7.0.55"
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:1.9.9"
runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
}创建域名Person:
package person
class Person {
static constraints = {
}
String name
}和控制器:
package person
class PersonController {
static scaffold = Person
}也试着使用: static scaffold = true,它也不起作用。我尝试删除我的包目标。
但是在我的url (http://localhost:8090/grails-com.learning/person)中我什么也看不到

没有插件:

发布于 2021-05-21 04:17:24
请访问https://github.com/jeffbrown/adamscaffolding查看该项目。
grails-app/conf/BuildConfig.groovy#L49-L75
(不需要提到dependencies {}块中的脚手架插件,plugins {}块就是用来表达这一点的地方)
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
// runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
test "org.grails:grails-datastore-test-support:1.0.2-grails-2.4"
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.55"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:1.9.9"
// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
// Uncomment these to enable additional asset-pipeline capabilities
//compile ":sass-asset-pipeline:1.9.0"
//compile ":less-asset-pipeline:1.10.0"
//compile ":coffee-asset-pipeline:1.8.0"
//compile ":handlebars-asset-pipeline:1.3.0.3"
}grails-app/domain/person/Person.groovy
package person
class Person {
static constraints = {
}
String name
}grails-app/controllers/person/PersonController.groovy
package person
class PersonController {
static scaffold = Person
}该脚手架的行为符合预期。
https://stackoverflow.com/questions/67623638
复制相似问题