Spock 2.0 JDK compatibility #1348
-
I am currently testing Spock 2 and it seems Spock is not compatible with a JDK newer than 11 (currently testing with 16). My sut is compiled with Java 16 and when compiling the test sources I get "Unsupported class file major version 60" for the sut class. Since Groovy 3 is compatible with Java 16 I expected Spock to be as well.
Am I just missing something or is this a know issue? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Thanks for the report. The Spock 2.0 release has been automatically tested with Java 8, 11 and 15. JDK 16 is problematic due to required Gradle upgrade to 7.x (which could shake the transitive dependencies) or a need to adjust Gradle 6.x to use a separate JDK 16 just to compile and execute tests. That being said, there could be a problem with JDK 16, however, as you also mentioned Groovy 3.0.8 should be JDK 16 compatible, the project also uses asm 9.1 (JDK 17 compatible), so could you check that:
|
Beta Was this translation helpful? Give feedback.
-
I just gave it a try and here it worked fine. |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
Thanks for the replies. I was hesistent to create an issue since I expected something might be off. I will do more checks and if it doestn resolve, I will come back with the required info. |
Beta Was this translation helpful? Give feedback.
-
Issue seems solved. My problem was that the Quarkus-BOM was enforced by using enforcedPlatform and this always downgraded Groovy to 3.0.5. Replacing enforcedPlatform with platform gave me the option to upgrade to 3.0.8 Thanks for clarifying that Spock supports newer versions, which lead me on the right track |
Beta Was this translation helpful? Give feedback.
Issue seems solved. My problem was that the Quarkus-BOM was enforced by using enforcedPlatform and this always downgraded Groovy to 3.0.5. Replacing enforcedPlatform with platform gave me the option to upgrade to 3.0.8
Now I am hitting another issue with Groovy (not Spock related) because my Java sut is compiled with --enable-preview and this seems not be honored by the Groovy compiler.
Thanks for clarifying that Spock supports newer versions, which lead me on the right track