From cafbcfc198cf620285f08732bbf03f1b7ad40ce6 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Tue, 21 Nov 2023 01:35:37 +0200 Subject: [PATCH] Fix log4j-appender-2.17 latest dep tests (#9915) --- .../log4j/log4j-appender-2.17/javaagent/build.gradle.kts | 5 +++-- .../log4j/log4j-appender-2.17/library/build.gradle.kts | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts b/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts index 022c1c049e..6adaec6fa6 100644 --- a/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts +++ b/instrumentation/log4j/log4j-appender-2.17/javaagent/build.gradle.kts @@ -22,9 +22,10 @@ dependencies { testImplementation("org.awaitility:awaitility") - // this dependency is needed for the slf4j->log4j test if (testLatestDeps) { - testImplementation("org.apache.logging.log4j:log4j-slf4j2-impl:2.19.0") + // this dependency is needed for the slf4j->log4j test + testImplementation("org.apache.logging.log4j:log4j-slf4j2-impl:+") + testCompileOnly("biz.aQute.bnd:biz.aQute.bnd.annotation:7.0.0") } else { // log4j 2.17 doesn't have an slf4j2 bridge testImplementation("org.apache.logging.log4j:log4j-slf4j-impl:2.17.0") diff --git a/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts b/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts index 6a48ee260f..4296c4f3da 100644 --- a/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts +++ b/instrumentation/log4j/log4j-appender-2.17/library/build.gradle.kts @@ -6,4 +6,8 @@ dependencies { library("org.apache.logging.log4j:log4j-core:2.17.0") testImplementation("io.opentelemetry:opentelemetry-sdk-testing") + + if (findProperty("testLatestDeps") as Boolean) { + testCompileOnly("biz.aQute.bnd:biz.aQute.bnd.annotation:7.0.0") + } }