У меня с этой ошибкой уже третий день, и я не могу решить. Есть что-то, чего я не могу понять, и что бы я ни делал, ошибка все еще сохраняется.ОШИБКА SLF4J: Путь к классу содержит несколько привязок SLF4J jenkins cobertura maven
Я читаю книгу под названием «Дженкинс - окончательный путеводитель» (http://www.wakaleo.com/books/jenkins-the-definitive-guide), и я застрял на второй главе. В основном это пример того, как использовать Jenkins с Javadoc, JUnit и Cobertura плагин для Jenkins. Все работает, пока не дойду до Cobertura плагин части, где я получаю следующую ошибку:
[ERROR] SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Windows/System32/config/systemprofile/.m2/repository/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:/Windows/System32/config/systemprofile/.m2/repository/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]
Я видел другие проблемы, как у меня и заключение я получил то, что я должен либо включить о исключить зависимость в моем П. xml file/s (в этом примере на этом этапе используются только файлы pom). Мой файл pom.xml, который имеет SLF4J-простой выглядит следующим образом:
<project>
......
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
</project>
и нет явной зависимости к Logback-классический поэтому я не знаю, в какой зависимости используется. Я пытался использовать плагин зависимостей для Дженкинс и я получил этот результат:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ gameoflife-web ---
[INFO] com.wakaleo.gameoflife:gameoflife-web:war:1.0-SNAPSHOT
[INFO] +- com.wakaleo.gameoflife:gameoflife-core:jar:1.0-SNAPSHOT:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.0.2.RELEASE:compile
[INFO] | +- org.springframework:spring-asm:jar:3.0.2.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:3.0.2.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:3.0.2.RELEASE:compile
[INFO] | | \- org.springframework:spring-aop:jar:3.0.2.RELEASE:compile
[INFO] | +- org.springframework:spring-context-support:jar:3.0.2.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:3.0.2.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:3.0.2.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.springframework:spring-web:jar:3.0.2.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] +- org.easytesting:fest-assert:jar:1.4:compile
[INFO] | \- org.easytesting:fest-util:jar:1.1.6:compile
[INFO] +- org.slf4j:slf4j-simple:jar:1.6.1:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- junit:junit:jar:4.11:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] \- org.hamcrest:hamcrest-all:jar:1.1:test
Может быть, я слепой, но я до сих пор не могу видеть, кто использует Logback-классический (кстати, я не уверен, какие значения верны для и для logback-classic). Я попытался удалить slf4j зависимостей, и я ошибся, но я не получаю никаких сообщений cobertura. Я попытался исключить Logback-классический с
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
</exclusions>
</dependency>
и ошибка не будет устранена. Я не знаю, что делать дальше, пожалуйста, помогите!
Возможный дубликат [Разрешить множественные привязки SLF4J в проекте maven] (http://stackoverflow.com/questions/11758676/resolve-multiple-slf4j-bindings-in-maven-project) –
Да, возможно, это возможно повторяю, когда я точно знаю, я его обновлю. –