From bb22b6a52aff86afcc20bfca62c738f8129e805c Mon Sep 17 00:00:00 2001 From: Jinwoo Hwang Date: Fri, 9 Jan 2026 22:04:18 -0500 Subject: [PATCH 1/3] GEODE-10544: Upgrade Log4j from 2.17.2 to 2.25.3 - Updated Log4j version to 2.25.3 in dependency constraints - Added GraalVM annotation processor configuration for geode-log4j - Migrated test dependencies from log4j-core::tests to log4j-core-test artifact - Updated 20 integration test files to use new package structure: * org.apache.logging.log4j.junit -> org.apache.logging.log4j.core.test.junit * org.apache.logging.log4j.test.appender -> org.apache.logging.log4j.core.test.appender - Suppressed deprecation warning for Message.getFormat() method - Added exclusions for Maven transitive dependencies to resolve Guava conflicts - All quality checks pass: build, spotlessCheck, rat, checkPom, japicmp --- .../gradle/plugins/DependencyConstraints.groovy | 3 ++- geode-log4j/build.gradle | 14 ++++++++++++-- .../impl/AlertAppenderIntegrationTest.java | 2 +- .../BothLogWriterAppendersIntegrationTest.java | 2 +- .../CacheWithCustomLogConfigIntegrationTest.java | 4 ++-- ...gurationWithLogLevelChangesIntegrationTest.java | 2 +- ...penderWithLoggerContextRuleIntegrationTest.java | 2 +- ...mWithBothLogWriterAppendersIntegrationTest.java | 2 +- ...edSystemWithLogLevelChangesIntegrationTest.java | 2 +- .../internal/impl/FastLoggerIntegrationTest.java | 2 +- ...reVerboseMarkerFilterAcceptIntegrationTest.java | 4 ++-- ...fireVerboseMarkerFilterDenyIntegrationTest.java | 4 ++-- .../impl/GeodeConsoleAppenderIntegrationTest.java | 2 +- ...odeConsoleAppenderWithCacheIntegrationTest.java | 2 +- ...leAppenderWithSystemOutRuleIntegrationTest.java | 2 +- ...deVerboseMarkerFilterAcceptIntegrationTest.java | 4 ++-- ...eodeVerboseMarkerFilterDenyIntegrationTest.java | 4 ++-- ...gServiceWithCustomLogConfigIntegrationTest.java | 4 ++-- .../impl/LogWriterAppenderIntegrationTest.java | 2 +- ...LogWriterAppenderWithLimitsIntegrationTest.java | 2 +- ...AppenderWithMemberNameInXmlIntegrationTest.java | 2 +- .../SecurityLogWriterAppenderIntegrationTest.java | 2 +- .../api/message/GemFireParameterizedMessage.java | 1 + 23 files changed, 41 insertions(+), 29 deletions(-) diff --git a/build-tools/geode-dependency-management/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy b/build-tools/geode-dependency-management/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy index 61c7141d6926..07c45e36004d 100644 --- a/build-tools/geode-dependency-management/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy +++ b/build-tools/geode-dependency-management/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy @@ -39,7 +39,7 @@ class DependencyConstraints { deps.put("fastutil.version", "8.5.8") deps.put("javax.transaction-api.version", "1.3") deps.put("jgroups.version", "3.6.20.Final") - deps.put("log4j.version", "2.17.2") + deps.put("log4j.version", "2.25.3") deps.put("micrometer.version", "1.9.1") deps.put("shiro.version", "1.13.0") deps.put("slf4j-api.version", "1.7.32") @@ -215,6 +215,7 @@ class DependencyConstraints { dependencySet(group: 'org.apache.logging.log4j', version: get('log4j.version')) { entry('log4j-api') entry('log4j-core') + entry('log4j-core-test') entry('log4j-jcl') entry('log4j-jul') entry('log4j-slf4j-impl') diff --git a/geode-log4j/build.gradle b/geode-log4j/build.gradle index d2501c2a7a7e..7dbe1fb597fe 100644 --- a/geode-log4j/build.gradle +++ b/geode-log4j/build.gradle @@ -21,6 +21,14 @@ plugins { id 'jmh' } +// Suppress Log4j 2.25.3 GraalVM annotation processor warning +tasks.withType(JavaCompile) { + options.compilerArgs.addAll([ + '-Alog4j.graalvm.groupId=org.apache.geode', + '-Alog4j.graalvm.artifactId=geode-log4j' + ]) +} + dependencies { api(platform(project(':boms:geode-all-bom'))) @@ -63,8 +71,10 @@ dependencies { exclude module: 'geode-core' } integrationTestImplementation('junit:junit') - integrationTestImplementation('org.apache.logging.log4j:log4j-core::tests') - integrationTestImplementation('org.apache.logging.log4j:log4j-core::test-sources') + integrationTestImplementation('org.apache.logging.log4j:log4j-core-test') { + exclude group: 'org.apache.maven' + exclude group: 'org.apache.logging.log4j', module: 'log4j-api-test' + } integrationTestImplementation('org.assertj:assertj-core') distributedTestImplementation(project(':geode-junit')) { diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/alerting/log4j/internal/impl/AlertAppenderIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/alerting/log4j/internal/impl/AlertAppenderIntegrationTest.java index 1a43d58917ec..0bd54f409023 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/alerting/log4j/internal/impl/AlertAppenderIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/alerting/log4j/internal/impl/AlertAppenderIntegrationTest.java @@ -36,7 +36,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/BothLogWriterAppendersIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/BothLogWriterAppendersIntegrationTest.java index 2f347145a439..b93a506ff672 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/BothLogWriterAppendersIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/BothLogWriterAppendersIntegrationTest.java @@ -26,7 +26,7 @@ import java.net.URL; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/CacheWithCustomLogConfigIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/CacheWithCustomLogConfigIntegrationTest.java index 4e4098ae896a..17663784046f 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/CacheWithCustomLogConfigIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/CacheWithCustomLogConfigIntegrationTest.java @@ -30,8 +30,8 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/ConfigurationWithLogLevelChangesIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/ConfigurationWithLogLevelChangesIntegrationTest.java index 1d4773144673..ea1bd4db3b74 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/ConfigurationWithLogLevelChangesIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/ConfigurationWithLogLevelChangesIntegrationTest.java @@ -29,7 +29,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/ConsoleAppenderWithLoggerContextRuleIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/ConsoleAppenderWithLoggerContextRuleIntegrationTest.java index 9b73b57d23db..41dfb704a690 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/ConsoleAppenderWithLoggerContextRuleIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/ConsoleAppenderWithLoggerContextRuleIntegrationTest.java @@ -28,7 +28,7 @@ import org.apache.logging.log4j.core.appender.ConsoleAppender; import org.apache.logging.log4j.core.appender.DefaultErrorHandler; import org.apache.logging.log4j.core.appender.OutputStreamManager; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/DistributedSystemWithBothLogWriterAppendersIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/DistributedSystemWithBothLogWriterAppendersIntegrationTest.java index 5834692a2f54..ab57b6aa24d1 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/DistributedSystemWithBothLogWriterAppendersIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/DistributedSystemWithBothLogWriterAppendersIntegrationTest.java @@ -27,7 +27,7 @@ import java.util.Properties; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/DistributedSystemWithLogLevelChangesIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/DistributedSystemWithLogLevelChangesIntegrationTest.java index b404b5d1754c..62ef3caed9de 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/DistributedSystemWithLogLevelChangesIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/DistributedSystemWithLogLevelChangesIntegrationTest.java @@ -31,7 +31,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/FastLoggerIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/FastLoggerIntegrationTest.java index e624d4d599fe..391fcfae85a6 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/FastLoggerIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/FastLoggerIntegrationTest.java @@ -30,7 +30,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Marker; import org.apache.logging.log4j.MarkerManager; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GemfireVerboseMarkerFilterAcceptIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GemfireVerboseMarkerFilterAcceptIntegrationTest.java index e25ebfe32e04..19f759b2a3ca 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GemfireVerboseMarkerFilterAcceptIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GemfireVerboseMarkerFilterAcceptIntegrationTest.java @@ -24,8 +24,8 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GemfireVerboseMarkerFilterDenyIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GemfireVerboseMarkerFilterDenyIntegrationTest.java index 1d02f5ed8234..c7cbc9bab532 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GemfireVerboseMarkerFilterDenyIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GemfireVerboseMarkerFilterDenyIntegrationTest.java @@ -23,8 +23,8 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderIntegrationTest.java index 9ea97fa3ff63..3177f9ab1009 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderIntegrationTest.java @@ -28,7 +28,7 @@ import org.apache.logging.log4j.core.appender.ConsoleAppender; import org.apache.logging.log4j.core.appender.DefaultErrorHandler; import org.apache.logging.log4j.core.appender.OutputStreamManager; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderWithCacheIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderWithCacheIntegrationTest.java index c26056d736a3..1c1a46eb5c11 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderWithCacheIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderWithCacheIntegrationTest.java @@ -27,7 +27,7 @@ import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderWithSystemOutRuleIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderWithSystemOutRuleIntegrationTest.java index d4aff795238d..0a5a80e00aa3 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderWithSystemOutRuleIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeConsoleAppenderWithSystemOutRuleIntegrationTest.java @@ -21,7 +21,7 @@ import java.net.URL; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeVerboseMarkerFilterAcceptIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeVerboseMarkerFilterAcceptIntegrationTest.java index 0a69499a778e..02adc6269365 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeVerboseMarkerFilterAcceptIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeVerboseMarkerFilterAcceptIntegrationTest.java @@ -24,8 +24,8 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeVerboseMarkerFilterDenyIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeVerboseMarkerFilterDenyIntegrationTest.java index f369f0a0dbbf..007017d708aa 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeVerboseMarkerFilterDenyIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/GeodeVerboseMarkerFilterDenyIntegrationTest.java @@ -24,8 +24,8 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogServiceWithCustomLogConfigIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogServiceWithCustomLogConfigIntegrationTest.java index c4084d85f92a..d01ad2b74cb5 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogServiceWithCustomLogConfigIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogServiceWithCustomLogConfigIntegrationTest.java @@ -25,8 +25,8 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; -import org.apache.logging.log4j.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.appender.ListAppender; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderIntegrationTest.java index 8926636c13c5..5a24646b0c73 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderIntegrationTest.java @@ -31,7 +31,7 @@ import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.LogEvent; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderWithLimitsIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderWithLimitsIntegrationTest.java index 71f90b4c4bdd..1afc5892e5ba 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderWithLimitsIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderWithLimitsIntegrationTest.java @@ -24,7 +24,7 @@ import java.io.File; import java.net.URL; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderWithMemberNameInXmlIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderWithMemberNameInXmlIntegrationTest.java index afc197790a21..5f64d1f5381a 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderWithMemberNameInXmlIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/LogWriterAppenderWithMemberNameInXmlIntegrationTest.java @@ -34,7 +34,7 @@ import java.util.regex.Pattern; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/SecurityLogWriterAppenderIntegrationTest.java b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/SecurityLogWriterAppenderIntegrationTest.java index 00ae368a332d..0d6b0c69e170 100644 --- a/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/SecurityLogWriterAppenderIntegrationTest.java +++ b/geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/SecurityLogWriterAppenderIntegrationTest.java @@ -25,7 +25,7 @@ import java.net.URL; import org.apache.logging.log4j.Logger; -import org.apache.logging.log4j.junit.LoggerContextRule; +import org.apache.logging.log4j.core.test.junit.LoggerContextRule; import org.junit.Before; import org.junit.BeforeClass; import org.junit.ClassRule; diff --git a/geode-logging/src/main/java/org/apache/geode/logging/internal/log4j/api/message/GemFireParameterizedMessage.java b/geode-logging/src/main/java/org/apache/geode/logging/internal/log4j/api/message/GemFireParameterizedMessage.java index 4b04ded31d2d..c5ad104c2df3 100755 --- a/geode-logging/src/main/java/org/apache/geode/logging/internal/log4j/api/message/GemFireParameterizedMessage.java +++ b/geode-logging/src/main/java/org/apache/geode/logging/internal/log4j/api/message/GemFireParameterizedMessage.java @@ -199,6 +199,7 @@ public String getFormattedMessage() { * @return the message pattern. */ @Override + @SuppressWarnings("deprecation") public String getFormat() { return messagePattern; } From 3df1413d2a08b03b09fe171b2dc80d6033ae9dcf Mon Sep 17 00:00:00 2001 From: Jinwoo Hwang Date: Sat, 10 Jan 2026 07:47:36 -0500 Subject: [PATCH 2/3] Fix integration test failures for Log4j 2.25.3 - Exclude JUnit 5.13.2 from log4j-core-test (conflicts with project's 5.8.2) - Exclude assertj-core 3.27.3 from log4j-core-test (conflicts with Geode's 3.22.0) - Add detailed comments explaining the exclusions This fixes the 26 integration test failures that occurred after upgrading Log4j from 2.17.2 to 2.25.3. The failures were caused by version conflicts in transitive dependencies brought in by log4j-core-test. Tested: ./gradlew :geode-log4j:integrationTest passes successfully --- geode-log4j/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/geode-log4j/build.gradle b/geode-log4j/build.gradle index 7dbe1fb597fe..7ace92c25e26 100644 --- a/geode-log4j/build.gradle +++ b/geode-log4j/build.gradle @@ -71,9 +71,18 @@ dependencies { exclude module: 'geode-core' } integrationTestImplementation('junit:junit') + // Log4j 2.20.0+ moved test utilities to log4j-core-test with new package names: + // org.apache.logging.log4j.junit → org.apache.logging.log4j.core.test.junit + // org.apache.logging.log4j.test → org.apache.logging.log4j.core.test + // log4j-core-test 2.25.3 transitively depends on assertj-core 3.27.3, but Geode's + // custom AssertJ assertions were built against 3.22.0. Force 3.22.0 to avoid + // NoSuchMethodError: CommonValidations.failIfEmptySinceActualIsNotEmpty integrationTestImplementation('org.apache.logging.log4j:log4j-core-test') { exclude group: 'org.apache.maven' exclude group: 'org.apache.logging.log4j', module: 'log4j-api-test' + exclude group: 'org.assertj', module: 'assertj-core' + exclude group: 'org.junit.jupiter' + exclude group: 'org.junit.platform' } integrationTestImplementation('org.assertj:assertj-core') From bf8b9d1633fd9d1ee1f7652e8c3b903193bf22c0 Mon Sep 17 00:00:00 2001 From: Jinwoo Hwang Date: Sat, 10 Jan 2026 08:08:50 -0500 Subject: [PATCH 3/3] Update build.gradle comments to explain all 5 dependency exclusions - Document maven-core exclusion (Guava conflict) - Document log4j-api-test exclusion (brings JUnit 5.13.2) - Document junit.jupiter/platform exclusions (version mismatch with 5.8.2) - Clarify all exclusions are required for support/1.15 branch --- geode-log4j/build.gradle | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/geode-log4j/build.gradle b/geode-log4j/build.gradle index 7ace92c25e26..10e8625b8f48 100644 --- a/geode-log4j/build.gradle +++ b/geode-log4j/build.gradle @@ -74,9 +74,13 @@ dependencies { // Log4j 2.20.0+ moved test utilities to log4j-core-test with new package names: // org.apache.logging.log4j.junit → org.apache.logging.log4j.core.test.junit // org.apache.logging.log4j.test → org.apache.logging.log4j.core.test - // log4j-core-test 2.25.3 transitively depends on assertj-core 3.27.3, but Geode's - // custom AssertJ assertions were built against 3.22.0. Force 3.22.0 to avoid - // NoSuchMethodError: CommonValidations.failIfEmptySinceActualIsNotEmpty + // log4j-core-test 2.25.3 requires the following exclusions: + // - assertj-core 3.27.3: conflicts with Geode's 3.22.0 custom assertions + // (NoSuchMethodError: CommonValidations.failIfEmptySinceActualIsNotEmpty) + // - maven-core 3.9.10: causes Gradle dependency resolution conflict with Guava + // - log4j-api-test: brings JUnit 5.13.2 transitively + // - junit.jupiter/platform 5.13.2: conflicts with project's JUnit 5.8.2 + // (JUnitException: OutputDirectoryProvider not available due to version mismatch) integrationTestImplementation('org.apache.logging.log4j:log4j-core-test') { exclude group: 'org.apache.maven' exclude group: 'org.apache.logging.log4j', module: 'log4j-api-test'