How to exclude a jar containing a StaticLoggerBinder from activemq-all maven?

I use ActiveMQ (apache camel component) to send SMS from the Internet to a GSM mobile phone, so I needed to use SLF4J. I got this in the results of my netbeans project, when I run it it seems that the jar is present twice, and I think I need to add an exception depending on my pom.xml, but I don’t know what to do!

This is part of SLF4 in mine pom.xml:

<!-- logging -->
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.7.5</version>

    <!--  <exclusions>
        <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </exclusion>
    </exclusions> -->
</dependency>

And this is my conclusion when starting my project

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/asus/.m2/repository/org/apache/activemq/activemq-all/5.9.0/activemq-all-5.9.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/asus/.m2/repository/org/slf4j/slf4j-log4j12/1.7.5/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
+4
source share
3 answers

Try the following:

<dependency>
    <groupId>org.apache.activemq</groupId>
    <artifactId>activemq-all</artifactId>
    <version>5.9.0</version>
    <type>pom</type>
</dependency>

[AMQ-5009] activemq- jar pom - ASF JIRA.

+4

, , slf4j-log4j12 POM, SLF4J activemq-all-5.9.0.jar.

, , activemq-all ActiveMQ .

+3

, activeemq-all, . , , 'all' . , Maven . , , , / .

( @bmargulies.)

+2

All Articles