Grails构建失败,出现异常

Grails构建失败,出现异常,grails,gorm,Grails,Gorm,在尝试数据库迁移时,我使用了Grails3.1.6,但构建失败。 我使用了grailsdbmgenerategormchangelogcreategame.groovy 以下是控制台输出: FAILURE: Build failed with an exception. * What went wrong: Task 'dbmGenerateGormChangelog' not found in root project 'gamereview'. * Try: Run gradle tas

在尝试数据库迁移时,我使用了Grails3.1.6,但构建失败。 我使用了
grailsdbmgenerategormchangelogcreategame.groovy
以下是控制台输出:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'dbmGenerateGormChangelog' not found in root project 'gamereview'.

* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED 
我手动添加

编译“org.grails.plugins:数据库迁移:2.0.0.RC4”

compile 'org.liquibase:liquibase-core:3.3.2'   in 
`build.gradle`  file 
进口有什么问题吗?需要帮助

解决方案:

在build.gradle的主要部分添加了
classpath'org.grails.plugins:database migration:2.0.0.RC4'
。 这就解决了问题。

带有命令的插件(包括数据库迁移和hibernate等)需要位于“主”依赖项块中(带有其他插件和常规jar依赖项),以便运行的应用程序可以使用这些类,但是由于Gradle运行这些命令,它们也需要位于
buildscript
块中的dependencies块中,例如

buildscript {
   repositories {
      mavenLocal()
      maven { url 'https://repo.grails.org/grails/core' }
   }
   dependencies {
      classpath "org.grails:grails-gradle-plugin:$grailsVersion"
      ...
      classpath 'org.grails.plugins:database-migration:2.0.0.RC4'
   }
}
带有命令的插件(包括数据库迁移、hibernate和其他一些)需要位于“主”依赖项块中(带有其他插件和常规jar依赖项),以便运行的应用程序可以使用这些类,但是由于Gradle运行这些命令,它们也需要位于
buildscript
块中的dependencies块中,例如

buildscript {
   repositories {
      mavenLocal()
      maven { url 'https://repo.grails.org/grails/core' }
   }
   dependencies {
      classpath "org.grails:grails-gradle-plugin:$grailsVersion"
      ...
      classpath 'org.grails.plugins:database-migration:2.0.0.RC4'
   }
}

你能给我一个build.gradle示例吗?我用示例
buildscript
块更新了答案。你能给我一个build.gradle示例吗?我用示例
buildscript
块更新了答案。