wakaleo / game-of-life

Demo application for the 'Jenkins: The Definitive Guide' book
http://www.wakaleo.com/books/jenkins-the-definitive-guide
2.04k stars 19.97k forks source link

[ERROR] SLF4J: Class path contains multiple SLF4J bindings. #40

Open KavyashreeJ opened 9 years ago

KavyashreeJ commented 9 years ago

Hello,

I am getting the following error after trying to use Corbertura:

SLF4J: Found binding in [jar:file:/C:/Users/usr1/.jenkins/workspace/game-of-life-default/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/usr1/.jenkins/workspace/game-of-life-default/org/slf4j/slf4j-simple/1.6.1/slf4j-simple-1.6.1.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 [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

I know that this problem has been discussed earlier. but I could not figure out where exactly to place the 'exclusion' tags(http://www.slf4j.org/codes.html#multiple_bindings). Any help to solve this problem will be appreciated.

Thank you.

schottsfired commented 9 years ago

Same issue here.

RizzoV commented 9 years ago

Same here

nichitapavel commented 9 years ago

I'm with same problem, tried to modify pom.xml where dependency appears (gameolife-acceptance-tests and gameoflife-web) but with no luck. If I remove dependency's there is no error but no cobertura report is generated, that means that the problem is with logback-classic and since it doesn't appear in any pom.xml it means that it's dependency is implicit and not explicit, I tried to remove it but i'm not sure if "groupId" and "artifactId" are correct. This is frustrating.

huevos-y-bacon commented 9 years ago

Did any of you get this working? Is anyone related to this book project actually monitoring these comments? John Smart? etc?

nichitapavel commented 9 years ago

I don't know how to make this error dissappear, but in order to generate cobertura report in Jenkins settings my goal was "cobertura:cobertura -Dcobertura.report.format=xml", it worked for me.

schottsfired commented 9 years ago

@nichitapavel thanks, your workaround suppresses the error. I'm seeing 0% coverage everywhere on the Cobertura reports- are you seeing the same?

nichitapavel commented 9 years ago

@shott85 as far as I can remember you are right, the coverage was 0%, but it did use the same settings in other project and the coverage was working fine, I don't know it this helps you, sorry for so late response.

timrsfo commented 9 years ago

i'm running this on ubuntu 12.04.5 with Java 7 and maven 3.1. I am getting the above error and I am not seeing any cobertura output file. I also tried the above "cobertura:cobertura -Dcobertura.report.format=xml" - still no output. Does this work for maven 3? I see there is a profile for maven3 and it doesn't have cobertura, it has jacoco. Does anybody know what I should be using on command line for maven3?

sabaker commented 8 years ago

I have it working in jenkins 2.1, with maven 3, and updated the maven-cobertura-plugin to 2.7.
Still used the "cobertura:cobertura -Dcobertura.report.format=xml" option to insure to get both xml and html and to remove the skip true configuration in the surefire plugin section to get nonzero coverage results.

I still see the SLFJ error.

sabaker commented 8 years ago

See related cobertura issue- https://github.com/mojohaus/cobertura-maven-plugin/issues/6

I've added the exclusion as indicated in dependencyManagement section of the POM, but it did not resolve it, I still get the error.

pradeepjadi commented 6 years ago

fixed with this


org.codehaus.mojo cobertura-maven-plugin 2.7 test ch.qos.logback logback-classic tools com.sun