1

Maven プロジェクトを gradle に変換しています。Maven では、c5-db-migration プラグインを使用しています。Gradleにそのようなものはありますか?

4

3 に答える 3

2

Flyway Ant Tasksを使用できます。また、作業中の gradle プラグインもあります (ベータ ステータス)。

例:

configurations {
    flyway
}

task flywayMigrate(dependsOn: "build") << {
    ext.flyway_classpath = files(sourceSets.main.output.resourcesDir) + files(configurations.flyway)
    ant.taskdef(name: 'flywayMigrate', classname: 'com.googlecode.flyway.ant.MigrateTask', classpath: ext.flyway_classpath.asPath)
    ant.flywayMigrate(driver: 'oracle.jdbc.driver.OracleDriver', url: 'myurl', user: 'myusername', password: 'mypassword',
            encoding: 'Cp1252', baseDir: 'sql')
}

dependencies {
    compile "com.googlecode.flyway:flyway-core:1.7"
    compile "com.oracle:ojdbc6:11.2.0.1.0"
    flyway "com.oracle:ojdbc6:11.2.0.1.0"
    flyway "com.googlecode.flyway:flyway-ant:1.7"
}
于 2012-10-10T08:52:08.870 に答える
1

@ (https://github.com/katta/gradle-flyway-plugin) で見つけることができるものを書きました

最も簡単な使用法は次のようになります

buildscript {
  repositories {
    mavenCentral()
    maven {
        url uri('http://katta.github.com/repository')
    }
  }
  dependencies {
    classpath 'org.katta.gradle.api.plugins:flyway:1.3'
    classpath 'postgresql:postgresql:9.1-901.jdbc4'
  }
}

apply plugin: 'flyway'

## replace properties with the values with your database settings
flyway {
    driver='org.postgresql.Driver'
    url='jdbc:postgresql://127.0.0.1/flyway' 
    user='postgres'
    password='s#cRet'
}

こちらのドキュメントでは、その使用方法について詳しく説明しています。使用中に問題が発生した場合はお知らせください。

于 2012-10-26T15:31:08.643 に答える
0

timberglundによって作成されたgradle用のliquibaseプラグインがあります。プラグインはgithubで入手できます:https ://github.com/tlberglund/gradle-liquibase-plugin

多分それはあなたを助けます。

乾杯、ルネ

于 2012-10-10T08:14:42.957 に答える