簡體   English   中英

如何在maven中排除slf4j為hector

[英]how to exclude in maven the slf4j for hector

在maven依賴項中,我添加了hector來評估Cassandra

<dependency>
   <groupId>org.hectorclient</groupId>
   <artifactId>hector-core</artifactId>
   <version>1.1-0</version>
</dependency>

並獲取以下logback消息

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/yulia/.m2/repository/org/slf4j/slf4j-  log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/yulia/.m2/repository/ch/qos/logback/logback-classic/0.9.24/logback-classic-0.9.24.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

如何從hector依賴項中排除slf4j?

你可以這樣做 -

<dependency>
   <groupId>org.hectorclient</groupId>
   <artifactId>hector-core</artifactId>
   <version>1.1-0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
</dependency>

我發現:-)!

這應該如下:

<dependency>
        <groupId>org.hectorclient</groupId>
        <artifactId>hector-core</artifactId>
        <version>1.1-0</version>
        <exclusions>
            <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

這種依賴來自cassandra-all

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM