how to exclude in maven the slf4j for hector

10,044

Solution 1

You can do something like this -

<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>

Solution 2

I've found :-) !

this should be as following:

<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>

This dependency comes from cassandra-all

Share:
10,044
Julias
Author by

Julias

Updated on June 04, 2022

Comments

  • Julias
    Julias almost 2 years

    In maven dependencies I've added the hector to evaluate the Cassandra

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

    and get the following logback message

    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.
    

    How can I exclude slf4j from the hector dependency ?

  • Julias
    Julias almost 12 years
    I've added, but this doesn't help. I see In the dependencies: org.hectorclient:hector-core -> org.apache.cassandra:cassandra-all -> org.slf4j
  • Pramod Kumar
    Pramod Kumar almost 12 years
    what is slf4j jar name Exact name