gpt4 book ai didi

java - SLF4J 版本不匹配和重复绑定(bind)

转载 作者:搜寻专家 更新时间:2023-11-01 01:04:09 24 4
gpt4 key购买 nike

我有一个使用以下 Maven 依赖项的项目:

<dependency>
<groupId>com.dropbox</groupId>
<artifactId>client2</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.0.3</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>simple</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>com.believer</groupId>
<artifactId>box4j</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire</artifactId>
<version>2.12</version>
</dependency>
</dependencies>

当我运行它时,它会发出警告并提示:

SLF4J: The requested version 1.5.10 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/kzhang/.m2/repository/org/slf4j/slf4j-jdk14/1.5.10/slf4j-jdk14-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/kzhang/.m2/repository/org/slf4j/slf4j-simple/1.5.10/slf4j-simple-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/kzhang/.m2/repository/org/slf4j/slf4j-log4j12/1.5.8/slf4j-log4j12-1.5.8.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

我的理解是有不止一个依赖包含slf4j。我应该可能从他们排除 slf4j。但我不知道我的哪一个依赖项实际上导致了这一点。

有人可以帮忙吗?

问候

最佳答案

尝试运行 mvn dependency:tree -Dincludes=*slf4j*。它应该向您显示哪个 Artifact 定义了对 slf4j 的依赖性。

附加参数可用于过滤特定的 slf4j 依赖项。有关插件和特定依赖项过滤的更多信息,请参阅 here .

关于java - SLF4J 版本不匹配和重复绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10451125/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com