From 47ce6f1666ecacf7234ba231b48d0054f08aa97e Mon Sep 17 00:00:00 2001 From: Pavlo Shevchenko Date: Tue, 18 Jul 2023 09:46:58 +0200 Subject: [PATCH] Check Spock2 presence on the module path only for Gradle 6.4+ Signed-off-by: Pavlo Shevchenko --- .../internal/executer/framework/TestFrameworkStrategy.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/org/gradle/testretry/internal/executer/framework/TestFrameworkStrategy.java b/plugin/src/main/java/org/gradle/testretry/internal/executer/framework/TestFrameworkStrategy.java index 823008de..9ea69464 100644 --- a/plugin/src/main/java/org/gradle/testretry/internal/executer/framework/TestFrameworkStrategy.java +++ b/plugin/src/main/java/org/gradle/testretry/internal/executer/framework/TestFrameworkStrategy.java @@ -52,7 +52,11 @@ static TestFrameworkStrategy of(JvmTestExecutionSpec spec) { } static boolean isSpock2Used(JvmTestExecutionSpec spec) { - return isSpock2JarOnPath(spec.getClasspath()) || isSpock2JarOnPath(spec.getModulePath()); + return isSpock2JarOnPath(spec.getClasspath()) || supportsJavaModules() && isSpock2JarOnPath(spec.getModulePath()); + } + + static boolean supportsJavaModules() { + return gradleVersionIsAtLeast("6.4"); } static boolean isSpock2JarOnPath(Iterable path) {