Skip to content

Instantly share code, notes, and snippets.

@xconnecting
Last active December 18, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xconnecting/5828289 to your computer and use it in GitHub Desktop.
Save xconnecting/5828289 to your computer and use it in GitHub Desktop.
[Gradle] Gradle Flyway Plugin sample
apply plugin: 'groovy'
apply plugin: 'flyway'
repositories { mavenCentral() }
dependencies {
compile localGroovy()
compile 'com.googlecode.flyway:flyway-core:2.1.1'
}
buildscript {
repositories { mavenCentral() }
dependencies {
classpath 'com.h2database:h2:1.3.171'
classpath 'com.github.ben-manes:gradle-flyway-plugin:0.6'
}
}
flyway {
dependsOnTasks(compileGroovy)
databases {
main {
url = "jdbc:h2:file:sampledb"
driver = 'org.h2.Driver'
user = 'SA'
password = ''
locations = [
'classpath:db.migration',
"filesystem:${projectDir}/build/classes/main"
]
}
}
}
task wrapper(type: Wrapper) { gradleVersion = '1.6' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment