Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore JDK6 compatibility for Gradle plugin #779

Closed
sajanchandran opened this issue Jun 17, 2014 · 6 comments
Closed

Restore JDK6 compatibility for Gradle plugin #779

sajanchandran opened this issue Jun 17, 2014 · 6 comments

Comments

@sajanchandran
Copy link

@sajanchandran sajanchandran commented Jun 17, 2014

Does flyway gradle plugin needs JRE 7 and above to run, am running using JRE 6 and am getting the below

  • What went wrong:
    A problem occurred evaluating root project 'hqly-test'.

    org/flywaydb/gradle/FlywayPlugin : Unsupported major.minor version 51.0

Please clarify.

@wh81752
Copy link

@wh81752 wh81752 commented Jul 1, 2014

The current version of Flyway requires at least Java 1.6 (classversion 50.0), see flyway's master pom and check for attributes source and target of plugin maven-compiler-plugin.

So far so good.

Now for flyway-gradle-plugin: it looks like that a build tool migration from Maven to Gradle takes place (a step in the right direction). Indeed, the build with maven-compiler-plugin is skipped or rather replace by gradle-maven-plugin which eventually runs gradle build.

So far everything is well setup. Within the gradle script then, pom.xml is read and some information is take over (mostly dependencies). The problem is, that flyway's master pom is not at all consulted. Therefore Java 1.6 is not forced and hence the current Java version is used.

Technically, all that is missing in build.gradle nothing more than:

compileGroovy {
  sourceCompatibility = 1.6
  targetCompatibility = 1.6

Here compileGroovy (http://www.gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.GroovyCompile.html) must be used cause in fact all source files are Groovy, file org/flywaydb/gradle/FlywayPlugin.java being the exception. Nevertheless, this file is also compile by Groovy due to the project layout.

@mauromol
Copy link

@mauromol mauromol commented Jul 30, 2014

I have the same problem, I cannot run Flyway from Gradle while using a JRE 1.6 (which is a must for us, since we target Java 1.6 and it's not that easy to target a JDK different from the one used to run Gradle itself).
Could you please fix this and release a hot fix?

@wh81752
Copy link

@wh81752 wh81752 commented Jul 30, 2014

@mauromol I believe that the fastest way to get it done simply is to clone gihub:flyway, add the compileGroovy section (as elaborated above) to build.gradle and build the distributable package yourself. That's what I did in the end ..

@mauromol
Copy link

@mauromol mauromol commented Aug 4, 2014

@wh81752: hi, since you fixed this for your own use, could you make a pull request to Axel to fix it at source? I think it would be appreciated.

rholder added a commit to rholder/flyway that referenced this issue Sep 2, 2014
…ode instead of forcing 1.7, some minor spacing fixes
@axelfontaine axelfontaine added this to the Flyway 3.1 milestone Sep 3, 2014
@axelfontaine axelfontaine changed the title Gradle plugin needs JRE 7 ? Restore JDK6 compatibility for Gradle plugin Sep 3, 2014
@mauromol
Copy link

@mauromol mauromol commented Sep 15, 2014

@axelfontaine : thanks for the fix, when do you plan to release Flyway 3.1? This fix is really precious for us...

@c4milo
Copy link

@c4milo c4milo commented Oct 30, 2014

when is 3.1 going out? I'm also in need for this.

wilkinsona added a commit to spring-projects/spring-boot that referenced this issue Jan 20, 2015
The 3.1 release includes an important fix to restore JDK 6
compatibility with the Gradle plugin [1].

Closes gh-2260

[1] flyway/flyway#779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

5 participants