|
@@ -20,6 +20,11 @@ dependencies {
|
|
|
shadowInclude("com.blogspot.mydailyjava:weak-lock-free")
|
|
|
}
|
|
|
|
|
|
+// patch inner class from Caffeine to avoid ForkJoinTask from being loaded too early in the javaagent
|
|
|
+val patch by sourceSets.creating {
|
|
|
+ java {}
|
|
|
+}
|
|
|
+
|
|
|
tasks {
|
|
|
shadowJar {
|
|
|
configurations = listOf(shadowInclude)
|
|
@@ -32,7 +37,15 @@ tasks {
|
|
|
|
|
|
val extractShadowJar by registering(Copy::class) {
|
|
|
dependsOn(shadowJar)
|
|
|
- from(zipTree(shadowJar.get().archiveFile))
|
|
|
+
|
|
|
+ // replace caffeine class with our patched version
|
|
|
+ from(zipTree(shadowJar.get().archiveFile)) {
|
|
|
+ exclude("io/opentelemetry/instrumentation/api/internal/shaded/caffeine/cache/BoundedLocalCache\$PerformCleanupTask.class")
|
|
|
+ }
|
|
|
+ from(patch.output) {
|
|
|
+ include("io/opentelemetry/instrumentation/api/internal/shaded/caffeine/cache/BoundedLocalCache\$PerformCleanupTask.class")
|
|
|
+ }
|
|
|
+
|
|
|
into("build/extracted/shadow")
|
|
|
// prevents empty com/github/benmanes/caffeine/cache path from ending up in instrumentation-api
|
|
|
includeEmptyDirs = false
|