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

Update Spock 1.3-groovy-2.5 to support Java 13 #1051

Closed
kdowbecki opened this issue Nov 15, 2019 · 4 comments
Closed

Update Spock 1.3-groovy-2.5 to support Java 13 #1051

kdowbecki opened this issue Nov 15, 2019 · 4 comments

Comments

@kdowbecki
Copy link

kdowbecki commented Nov 15, 2019

Issue description

Spock 1.3-groovy-2.5 depends on Groovy 2.5.4 which does not work with Java 13. Upgrading to Groovy 2.5.7 or newer solves the problem. See GROOVY-9020.

How to reproduce

Run tests with spock-spring-1.3-groovy-2.5 or other 1.3-groovy-2.5 dependency on Java 13. This will throw:

Caused by: BUG! exception in phase 'semantic analysis' 
  in source unit '/home/myself/project/Test.groovy' 
  Unsupported class file major version 57

Additional Environment information

OpenJDK 13.0.1 Zulu

Groovy version

2.5.4

Build tool version

Gradle

6.0

Operating System

Linux

Build-tool dependencies used

Gradle/Grails

testCompile group: 'org.spockframework', name: 'spock-spring', version: '1.3-groovy-2.5'
@BoukeNijhuis
Copy link

If you do not mind using a snapshot version and doing some extra config in the pom.xml you can use the following pom. This one works with Java 14 EA (and all versions below). I am not sure how to translate this to Gradle, but that is probably not so hard.

https://github.com/BoukeNijhuis/spock-with-new-java-versions/blob/master/pom.xml

I hope this helps.

@bsfowlie
Copy link

bsfowlie commented Nov 30, 2019

I have no problems running Spock 1.3-groovy-2.5 on Groovy 2.5.8, I just needed to put the dependency for Groovy 2.5.8 into my build.gradle file to override the version included by Spock 1.3-groovy-2.5. Should work the same if you are using Maven, just provide the Groovy dependency in the pom.xml file to override what comes with Spock.

Please see the build.gradle or pom.xml files in the spock-example project.

https://github.com/spockframework/spock-example

@SteveHigham
Copy link

I would like to see a Spock version with Groovy above 2.5.4 as well. I am developing on a Mac and this causes multiple tests to fail with an IllegalAccess exception when I moved from JDK 1.8 to JDK 11. This was using 1.3-groovy-2.5.
This issue is fixed by using 2.0-M1-groovy-2.5 but this is not a release version and is causing additional problems which I will record separately.

@leonard84
Copy link
Member

Thanks for raising the issue, but there won't be another 1.x release and since this can be easily handled by managing the groovy version as @bsfowlie mentioned above I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants