我发现graqu liquibase插件,许多人推荐我gradle-liquibase-plugintlberglund。我使用gradle这个版本1.2 我创建的build.gradle旁边结构:Liquibase for gradle插件
apply plugin: 'java'
apply plugin: 'liquibase'
repositories {
mavenCentral()
}
dependencies {
compile('org.hsqldb:hsqldb:2.2.8')
compile('org.hsqldb:sqltool:2.2.8')
compile('com.h2database:h2:1.3.167')
compile('org.liquibase:liquibase-core:2.0.1')
compile('com.augusttechgroup:groovy-liquibase-dsl:0.7.3')
compile('postgresql:postgresql:9.1-901.jdbc4')
}
buildscript {
dependencies {
classpath 'com.augusttechgroup:gradle-liquibase-plugin:0.6.1'
}
}
databases {
postgre {
url = "${postgreBaseUrl}" + "${postgreDB}"
username = "${postgreUserName}"
password = "${postgreUserPassword}"
}
}
changelogs {
main {
file = file('src/main/liquibase/mainChanges.groovy')
}
}
task dbInit << {
databases.postgre.url = "${postgreBaseUrl}"
databases.postgre.username = "${postgreRootUserName}"
databases.postgre.password = "${postgreRootUserPassword}"
changelogs.main.file = file('src/main/liquibase/tablespaceChanges.groovy')
}
当我试图运行“gradle这个建”的任务,我收到的短信
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':classpath'.
> Could not find group:com.augusttechgroup, module:gradle-liquibase-plugin, vers
ion:0.6.1.
Required by:
:demo:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to
get more log output.
BUILD FAILED
我从中央Maven仓库的依赖 maven repository
如果我把依赖标记为“编译”,那么好吧。
dependencies {
compile 'com.augusttechgroup:gradle-liquibase-plugin:0.6.1'
}
我检查我的本地库,发现有gradle这个-liquibase-插件-0.6.1.jar
我不明白有什么不对劲。我想作为原始文档中描述的在github
https://github.com/tlberglund/gradle-liquibase-plugin/blob/master/plugin.gradle
,但得到了同样的结果。也许有人使用这个插件?
我真的需要帮助,我的英语不好对不起)
你设法让这个插件的工作?尽管我能够实现它,但我发现它有很多问题,希望得到反馈,看看我是否是唯一遇到奇怪问题的人。 –