我正在使用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 进口有什么问题吗?需要帮助。
解决方案:
在classpath 'org.grails.plugins:database-migration:2.0.0.RC4'的主部分添加了build.gradle。解决了问题。
发布于 2016-05-03 04:47:18
带有命令的插件(这包括数据库迁移和hibernate等)需要位于“主”依赖项块中(与其他插件和常规的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'
}
}https://stackoverflow.com/questions/36995149
复制相似问题