Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/350.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么即使移除了SLF4J标记,仍能看到该标记_Java_Maven_Slf4j - Fatal编程技术网

Java 为什么即使移除了SLF4J标记,仍能看到该标记

Java 为什么即使移除了SLF4J标记,仍能看到该标记,java,maven,slf4j,Java,Maven,Slf4j,我在项目中使用了SLF4J,但我从maven项目中删除了所有依赖项,因为我不需要它。 不幸的是,当我运行我的项目时,我在下面看到了这一点。我在我的项目中没有看到任何SLF4J的句柄。 你能告诉我为什么我会看到这个吗 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http

我在项目中使用了SLF4J,但我从maven项目中删除了所有依赖项,因为我不需要它。 不幸的是,当我运行我的项目时,我在下面看到了这一点。我在我的项目中没有看到任何SLF4J的句柄。 你能告诉我为什么我会看到这个吗

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

org.java websocket:java websocket:jar:1.4.1
取决于
slf4j
。因此,您的项目依赖于
slf4j

我通过查看Maven Central上的POM文件发现了这一点

您可以自己使用Maven dependency checker插件来分析您的依赖关系:

顺便说一句,这种依赖关系看起来是错误的:

junit:junit:jar:4.13:compile

除非你的项目真的有什么不寻常的地方,否则它应该有
test
的范围,而不是
compile

可能你的其他依赖项使用slf4j。使用maven依赖项检查器插件分析您的依赖项:所有我的依赖项:[org.mockito:mockito核心:jar:3.2.4:test org.yaml:snakeyaml:jar:1.21:compile junit:junit:jar:4.13:compile org.java websocket:java websocket:jar:1.4.1:compile com.jayway.jsonpath:json路径:json路径:jar:2.4.0:compile]