Grails 3 schema-export in build.gradle

2019-09-12 06:19发布

问题:

In Grails 2 I had a nifty gradle task that would generate DDL for me:

task extractGrailsDDL(type: org.grails.gradle.plugin.tasks.GrailsTask) {
    command "schema-export"
    args  ddlFileName("Temp") + " --datasouce=operator"

}

But that doesn't work in Grails 3, I get that, a lot has changed.

The question is: How can I create a Gradle Task to run a schema export and pass file name and datasource parameters to it?

回答1:

You don't need to create a Gradle task. A task already exists.

http://docs.grails.org/latest/ref/Command%20Line/schema-export.html