Grails构建失败的例外

时间:2016-05-03 03:35:34

标签: grails gorm

我在尝试数据库迁移时使用Grails 3.1.6我遇到了构建失败。 我用grails dbm-generate-gorm-changelog createGame.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 

我手动添加了

compile 'org.grails.plugins:database-migration: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'。 这解决了Probelm。

1 个答案:

答案 0 :(得分:0)

带命令的插件(包括数据库迁移和休眠以及其他一些命令)需要位于主要的'依赖块(使用其他插件和常规jar依赖项),因此这些类可供正在运行的应用程序使用,但由于Gradle运行命令,因此它们也需要位于buildscript块中的依赖项块中,例如

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'
   }
}
相关问题