我找到了 gradle 的 liquibase 插件,很多人从tlberglund推荐了我的 gradle-liquibase-plugin。我使用 gradle 版本 1.2 我创建 build.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 build”任务时,我收到了短信
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 存储库中获取了依赖项
如果我将依赖项标记为“编译”,那么好吧。
dependencies {
compile 'com.augusttechgroup:gradle-liquibase-plugin:0.6.1'
}
我检查了我的本地存储库,发现那里有 gradle-liquibase-plugin-0.6.1.jar
我不明白有什么问题。我按照github上原始文档中的描述进行了尝试
https://github.com/tlberglund/gradle-liquibase-plugin/blob/master/plugin.gradle
但得到了相同的结果。也许有人用过这个插件?
我真的需要帮助,很抱歉我的英语不好)