![](/img/trans.png)
[英]Liquibase Gradle Plugin is dropping hibernate sequence table on generated changelog
[英]Liquibase plugin for gradle
我找到gradle這個liquibase插件,很多人推薦我gradle這個-liquibase-插件從tlberglund。 我使用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')
}
當我嘗試運行“漸變構建”任務時,我收到了短信
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存儲庫獲取了依賴關系
如果我將依賴項標記為“編譯”,那么可以。
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
但是得到了相同的結果。 也許有人使用了這個插件?
我真的需要幫助,對不起我的英語不好)
該問題與Liquibase插件無關。 您只需要在buildscript {}
部分中聲明一個存儲庫。 buildscript {}
與腳本的其余部分完全分開。 您幾乎可以將其視為一個單獨的文件。
查看github上的源代碼(請參閱build.gradle文件),看起來這些版本已發布在oss.sonatype.org上。 嘗試使用添加“ https://oss.sonatype.org/content/repositories/releases/ ”作為Maven存儲庫
因此,您的build.gradle可能如下所示:
buildscript { repositories { maven { url uri('https://oss.sonatype.org/content/repositories/releases/') } mavenCentral() } dependencies { classpath group:'net.saliman', name: 'gradle-liquibase-plugin', version: '1.0.0' } } apply plugin: 'liquibase'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.