diff --git a/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle b/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle index 4cebc586ab3..9109cf87d89 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle +++ b/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle @@ -27,7 +27,7 @@ addTestSuiteExtendingForDir("jetty11LatestDepTest", "latestDepTest", "test/jetty ["compileJetty11TestGroovy", "compileJetty11LatestDepTestGroovy"].each { name -> tasks.named(name, GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } } diff --git a/dd-java-agent/instrumentation/axis2-1.3/build.gradle b/dd-java-agent/instrumentation/axis2-1.3/build.gradle index 174fc2d3ed4..5894b66998d 100644 --- a/dd-java-agent/instrumentation/axis2-1.3/build.gradle +++ b/dd-java-agent/instrumentation/axis2-1.3/build.gradle @@ -25,7 +25,7 @@ configurations.configureEach { ["compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy"].each { tasks.named(it, GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } } diff --git a/dd-java-agent/instrumentation/cxf-2.1/build.gradle b/dd-java-agent/instrumentation/cxf-2.1/build.gradle index 25d27b028ab..8be21374cef 100644 --- a/dd-java-agent/instrumentation/cxf-2.1/build.gradle +++ b/dd-java-agent/instrumentation/cxf-2.1/build.gradle @@ -32,7 +32,7 @@ tasks.named("compileLatestDepTestJava", JavaCompile) { } tasks.named("compileLatestDepTestGroovy", GroovyCompile) { - javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } tasks.named("latestDepTest", Test) { @@ -40,7 +40,7 @@ tasks.named("latestDepTest", Test) { } tasks.named("compileCxf3LatestDepTestGroovy", GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } tasks.named("cxf3LatestDepTest", Test) { diff --git a/dd-java-agent/instrumentation/ignite-2.0/build.gradle b/dd-java-agent/instrumentation/ignite-2.0/build.gradle index 543b1050085..69be7f06472 100644 --- a/dd-java-agent/instrumentation/ignite-2.0/build.gradle +++ b/dd-java-agent/instrumentation/ignite-2.0/build.gradle @@ -45,6 +45,6 @@ dependencies { for (task in ['compileLatestDepTestGroovy', 'compileLatestDepForkedTestGroovy']) { tasks.named(task, GroovyCompile) { - it.javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } } diff --git a/dd-java-agent/instrumentation/jakarta-jms/build.gradle b/dd-java-agent/instrumentation/jakarta-jms/build.gradle index 301cc89c030..a86e2f3750c 100644 --- a/dd-java-agent/instrumentation/jakarta-jms/build.gradle +++ b/dd-java-agent/instrumentation/jakarta-jms/build.gradle @@ -25,7 +25,7 @@ repositories { } tasks.named("compileTestGroovy", GroovyCompile) { - it.javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } dependencies { diff --git a/dd-java-agent/instrumentation/jakarta-rs-annotations-3/build.gradle b/dd-java-agent/instrumentation/jakarta-rs-annotations-3/build.gradle index 60c00532ef0..f1ccdf7db98 100644 --- a/dd-java-agent/instrumentation/jakarta-rs-annotations-3/build.gradle +++ b/dd-java-agent/instrumentation/jakarta-rs-annotations-3/build.gradle @@ -17,7 +17,7 @@ tasks.named("compileLatestDepJava11TestJava", JavaCompile) { } tasks.named("compileLatestDepJava11TestGroovy", GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } tasks.named("latestDepJava11Test", Test) { diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/build.gradle b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/build.gradle index 7987b836056..16cac45bf41 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/build.gradle +++ b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/build.gradle @@ -17,7 +17,7 @@ tasks.named("compileMain_java11Java", JavaCompile) { } tasks.named("compileTestGroovy", GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } tasks.named("forbiddenApisMain_java11") { diff --git a/dd-java-agent/instrumentation/jersey/build.gradle b/dd-java-agent/instrumentation/jersey/build.gradle index 887cbdc0e57..0b66d4d3ed8 100644 --- a/dd-java-agent/instrumentation/jersey/build.gradle +++ b/dd-java-agent/instrumentation/jersey/build.gradle @@ -20,7 +20,7 @@ addTestSuiteForDir('jersey2JettyTest', 'jersey2JettyTest') addTestSuiteForDir('jersey3JettyTest', 'jersey3JettyTest') tasks.named("compileJersey3JettyTestGroovy", GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } compileTestJava.configure { diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle index 0b72971f6a9..c7271771f4c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle @@ -49,7 +49,7 @@ tasks.named("forbiddenApisMain_java17") { } tasks.withType(GroovyCompile).configureEach { - javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } dependencies { diff --git a/dd-java-agent/instrumentation/play/play-2.4/build.gradle b/dd-java-agent/instrumentation/play/play-2.4/build.gradle index be824377a54..0026dfbf8b0 100644 --- a/dd-java-agent/instrumentation/play/play-2.4/build.gradle +++ b/dd-java-agent/instrumentation/play/play-2.4/build.gradle @@ -46,8 +46,8 @@ repositories { } } -tasks.withType(org.gradle.api.tasks.scala.ScalaCompile) { - it.javaLauncher = getJavaLauncherFor(8) +tasks.withType(ScalaCompile).configureEach { + configureCompiler(it, 8) } addTestSuiteForDir('latestDepTest', 'test') diff --git a/dd-java-agent/instrumentation/play/play-2.6/build.gradle b/dd-java-agent/instrumentation/play/play-2.6/build.gradle index aa0a2b9b738..32a1f37ff8f 100644 --- a/dd-java-agent/instrumentation/play/play-2.6/build.gradle +++ b/dd-java-agent/instrumentation/play/play-2.6/build.gradle @@ -139,7 +139,7 @@ tasks.named("compileLatestDepTestJava", JavaCompile) { } tasks.named("compileLatestDepTestScala", ScalaCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) classpath = classpath + files(compileBaseTestJava.destinationDirectory) dependsOn 'compileBaseTestJava' } @@ -192,7 +192,7 @@ tasks.register('buildLatestDepTestRoutes', JavaExec) { } tasks.named("compileLatestDepTestGeneratedScala", ScalaCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) classpath = classpath + files(compileLatestDepTestScala.destinationDirectory) dependsOn buildLatestDepTestRoutes, compileLatestDepTestScala } @@ -202,7 +202,7 @@ tasks.named("forbiddenApisLatestDepTestGenerated") { } tasks.named("compileLatestDepTestGroovy", GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) classpath = classpath + files(compileLatestDepTestScala.destinationDirectory) + files(compileBaseTestGroovy.destinationDirectory) + diff --git a/dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle b/dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle index fba6eb65f8b..8aa99376089 100644 --- a/dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-boot-1.3/build.gradle @@ -33,7 +33,7 @@ addTestSuiteExtendingForDir("latestDepForkedTest", "latestDepTest", "test") ["compileLatestDepTestGroovy", "compileBoot3TestGroovy"].each { name -> tasks.named(name, GroovyCompile) { - javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } } diff --git a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/build.gradle b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/build.gradle index d0ef3d36d47..aaee162df55 100644 --- a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/build.gradle @@ -18,7 +18,7 @@ addTestSuiteForDir('latestDepTest', 'test') ["compileTestGroovy", "compileLatestDepTestGroovy"].each { name -> tasks.named(name, GroovyCompile) { - javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } } diff --git a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle index f544d3bfb97..6a17318430c 100644 --- a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/build.gradle @@ -35,7 +35,7 @@ addTestSuiteForDir('latestSpring5Test', 'test') ["compileSpring6TestGroovy", "compileLatestDepTestGroovy", "compileLatestDepForkedTestGroovy"].each { name -> tasks.named(name, GroovyCompile) { - javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } } diff --git a/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/build.gradle b/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/build.gradle index 92e9a9e297f..67d0c8ae4f2 100644 --- a/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/build.gradle @@ -12,7 +12,7 @@ tasks.withType(AbstractCompile).configureEach { } tasks.withType(GroovyCompile).configureEach { - javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } dependencies { diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/build.gradle b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/build.gradle index 385a4679eeb..c3ca09f8caf 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/build.gradle +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/build.gradle @@ -16,7 +16,7 @@ tasks.withType(JavaCompile).configureEach { } tasks.withType(GroovyCompile).configureEach { - it.javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } tasks.named("iastTest", Test) { diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle b/dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle index b05e0020933..f8d2e1a143b 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle +++ b/dd-java-agent/instrumentation/tomcat/tomcat-5.5/build.gradle @@ -74,13 +74,13 @@ configurations.configureEach { ["compileLatest10TestGroovy", "compileLatest10ForkedTestGroovy"].each { name -> tasks.named(name, GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } } ["compileLatestDepTestGroovy", "compileLatestDepForkedTestGroovy"].each { name -> tasks.named(name, GroovyCompile) { - javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } } diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11/build.gradle b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11/build.gradle index a1fbd11bb79..8bffea9cfe4 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11/build.gradle +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11/build.gradle @@ -19,7 +19,7 @@ addTestSuite("latestDepTest") ["compileTestGroovy", "compileLatestDepTestGroovy"].each { name -> tasks.named(name, GroovyCompile) { - javaLauncher = getJavaLauncherFor(11) + configureCompiler(it, 11) } } diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12/build.gradle b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12/build.gradle index 7ae85334ed4..ca29fca2746 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12/build.gradle +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12/build.gradle @@ -32,7 +32,7 @@ addTestSuiteForDir("latestDepTest", "test") ["compileTestGroovy", "compileLatestDepTestGroovy"].each { name -> tasks.named(name, GroovyCompile) { - javaLauncher = getJavaLauncherFor(17) + configureCompiler(it, 17) } }