flyway/flyway — pull request #13 by ben-manes (2013-03-13 10:06:02+00:00)
Title: Gradle plugin

A gradle plugin based on the Flyway 2.x series ([original](https://github.com/ben-manes/gradle-flyway-plugin)).

This plugin is integrated into the Maven build using the [gradle-maven-plugin](https://github.com/if6was9/gradle-maven-plugin) to invoke the gradle build. The gradle build self-installs using the wrapper and, on an install, publishes to the local maven repository. This approach was chosen as the gradle apis are not published to a maven repository and that dependency appears to have blocked previous efforts for integrating a plugin into flyway.

Due to the multi-build integration, I am unsure whether `mvn deploy` will recognize the produced artifact and attach it during a `mvn release:prepare release:perform` process. This should be tested by the project owner.

A sample project is included. A richer [sample](https://github.com/ben-manes/gradle-jooq-plugin/tree/master/example) shows integration of flyway, H2, jOOQ, and ModelMapper for performing round-trip operations in a test class.

A known limitation is that the plugin does not pick up Java-based migrations. This is likely due to the class files not being on the classpath, as the `buildscript` is setup prior to the project. This may require invoking flyway as a JavaExec or command-line process instead. As Gradle does not promote itself as a deployment tool (see fabric, capistrano, etc) the SQL migrations may suffice for the community's needs.