由于内部依赖于log4j-1.2.17(CVE-2019-1757),因此无法使用hbase-shaded-client jar

问题描述 投票:0回答:1

是否有排除它的方法。我确实尝试了一下,但得到ClassNotFoundException:org.apache.log4j.Level我确实看到hbase-shaded-client确实具有slf4j依赖性,因此可能有一种排除log4j并使用slf4j的方法,但我无法。

hadoop log4j hbase
1个回答
0
投票

是,您可以排除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>
© www.soinside.com 2019 - 2024. All rights reserved.