我遇到了SLF4J: Class path contains multiple SLF4J bindings.
,我通常知道如何通过在依赖项中添加某种排除来解决该问题。
这是两个冲突的绑定:
SLF4J: Found binding in [jar:file:/test-service/WEB-INF/lib/oak-upgrade-1.4.17.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/sap/ljs/bin/logback-classic.jar!/org/slf4j/impl/StaticLoggerBinder.class]
当我运行mvndependency:tree时,logback-classic.jar是应用程序运行所在的容器提供的依赖项。因此,我认为我唯一的选择是从Oak-Upgrade中排除某种日志记录依赖项。
这是到目前为止我尝试排除的pom.xml中的内容:
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-upgrade</artifactId>
<version>1.4.17</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<artifactId>slf4j-simple</artifactId>
<groupId>org.slf4j</groupId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
请告诉我是否有其他解决方案,或者我是否缺少简单的排除方法。
谢谢!