@@ -3,6 +3,7 @@ package com.datadoghq.profiler
33
44import org.gradle.api.Plugin
55import org.gradle.api.Project
6+ import org.gradle.api.artifacts.VersionCatalogsExtension
67import org.gradle.api.tasks.compile.JavaCompile
78
89/* *
@@ -11,6 +12,7 @@ import org.gradle.api.tasks.compile.JavaCompile
1112 * Applies standard Java compilation options across all subprojects:
1213 * - Java 8 release target for broad JVM compatibility
1314 * - Suppresses JDK 21+ deprecation warnings for --release 8
15+ * - Redirects org.lz4:lz4-java to at.yawk.lz4:lz4-java (community fork)
1416 *
1517 * Requires JDK 21+ for building (Gradle 9 requirement).
1618 * The compiled bytecode targets Java 8 runtime.
@@ -29,5 +31,16 @@ class JavaConventionsPlugin : Plugin<Project> {
2931 // The deprecation is informational - Java 8 targeting still works
3032 options.compilerArgs.addAll(listOf (" --release" , " 8" , " -Xlint:-options" ))
3133 }
34+
35+ // Redirect org.lz4:lz4-java → at.yawk.lz4:lz4-java (community fork)
36+ // JMC flightrecorder transitively depends on the old coordinates
37+ val libs = project.extensions.getByType(VersionCatalogsExtension ::class .java).named(" libs" )
38+ val lz4Version = libs.findVersion(" lz4" ).orElseThrow().requiredVersion
39+ project.configurations.all {
40+ resolutionStrategy.dependencySubstitution {
41+ substitute(module(" org.lz4:lz4-java" ))
42+ .using(module(" at.yawk.lz4:lz4-java:$lz4Version " ))
43+ }
44+ }
3245 }
3346}
0 commit comments