是否有排除它的方法。我确实尝试了一下,但得到ClassNotFoundException:org.apache.log4j.Level我确实看到hbase-shaded-client确实具有slf4j依赖性,因此可能有一种排除log4j并使用slf4j的方法,但我无法。
是,您可以排除log4j
,但必须在log4j-over-slf4j
中加回来。
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>[some version]</version>
<exclusions>
<exclusion>
<artifactId>log4j</artifactId>
<groupId>log4j</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
<version>[some version]</version>
</dependency>