GROOVY-9174: try junit-platform-launcher as compile-time-only dependency
diff --git a/subprojects/groovy-test-junit5/build.gradle b/subprojects/groovy-test-junit5/build.gradle
index 50ea702..f7f91a7 100644
--- a/subprojects/groovy-test-junit5/build.gradle
+++ b/subprojects/groovy-test-junit5/build.gradle
@@ -24,12 +24,13 @@
 
 dependencies {
     implementation rootProject
-    compile "org.junit.platform:junit-platform-launcher:$junit5PlatformVersion"
-    runtime "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
-    testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5Version"
-    testRuntime "org.junit.platform:junit-platform-engine:$junit5PlatformVersion"
-    testRuntime "org.junit.platform:junit-platform-runner:$junit5PlatformVersion"
+    runtimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit5Version"
+    compileOnly "org.junit.platform:junit-platform-launcher:$junit5PlatformVersion"
+
     testImplementation project(':groovy-test')
+    testImplementation "org.junit.jupiter:junit-jupiter-params:$junit5Version"
+    testRuntimeOnly "org.junit.platform:junit-platform-engine:$junit5PlatformVersion"
+    testRuntimeOnly "org.junit.platform:junit-platform-runner:$junit5PlatformVersion"
 }
 
 tasks.withType(JavaCompile) {