From e03d1d7629c8562b632ef255661026d1c6b8eb3e Mon Sep 17 00:00:00 2001 From: lingniu Date: Wed, 1 Jul 2026 06:52:21 +0800 Subject: [PATCH] fix: remove legacy commons logging from history runtime --- .../VehicleHistoryAppDefaultsTest.java | 16 ++++++++++++++++ pom.xml | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppDefaultsTest.java b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppDefaultsTest.java index bb8b1632..e5f51a1a 100644 --- a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppDefaultsTest.java +++ b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/VehicleHistoryAppDefaultsTest.java @@ -4,6 +4,9 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; import org.springframework.core.io.ClassPathResource; +import java.net.URL; +import java.util.Collections; +import java.util.List; import java.util.Properties; import static org.assertj.core.api.Assertions.assertThat; @@ -109,6 +112,19 @@ class VehicleHistoryAppDefaultsTest { || name.equals("lingniu.ingest.sink.archive.path")); } + @Test + void runtimeClasspathDoesNotContainLegacyCommonsLoggingJar() throws Exception { + List logFactoryResources = Collections.list(Thread.currentThread() + .getContextClassLoader() + .getResources("org/apache/commons/logging/LogFactory.class")) + .stream() + .map(URL::toExternalForm) + .toList(); + + assertThat(logFactoryResources) + .noneMatch(resource -> resource.contains("/commons-logging-")); + } + private static Properties applicationProperties() { YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean(); factory.setResources(new ClassPathResource("application.yml")); diff --git a/pom.xml b/pom.xml index 4569a999..9ad6e409 100644 --- a/pom.xml +++ b/pom.xml @@ -343,6 +343,12 @@ com.taosdata.jdbc taos-jdbcdriver ${taos-jdbcdriver.version} + + + commons-logging + commons-logging + + org.springdoc