fix: remove legacy commons logging from history runtime
This commit is contained in:
@@ -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<String> 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"));
|
||||
|
||||
6
pom.xml
6
pom.xml
@@ -343,6 +343,12 @@
|
||||
<groupId>com.taosdata.jdbc</groupId>
|
||||
<artifactId>taos-jdbcdriver</artifactId>
|
||||
<version>${taos-jdbcdriver.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
|
||||
Reference in New Issue
Block a user