我發現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
,但得到了同樣的結果。也許有人使用這個插件?
我真的需要幫助,我的英語不好對不起)
你設法讓這個插件的工作?儘管我能夠實現它,但我發現它有很多問題,希望得到反饋,看看我是否是唯一遇到奇怪問題的人。 –