Я пытаюсь запустить задачу, определенную в моем файле Gradle. Когда я запускаю его, я получаю следующую ошибку:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file://Repo/demo/build/install/lib/slf4j-jboss-logging-1.0.2.GA.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file://Repo/demo/build/install/demo/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x.
java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
at com.netspend.demojpos.Main.<clinit>(Main.java:35)
Exception in thread "main"
Исключение совершенно очевидно, что он получает определение класса в двух файлах. Но когда я пытаюсь исключить его, он не работает.
buildscript{
repositories{ ....}
configurations {
classpath {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
}
или другая зависимость, ничего не работает. Я перепробовал много решений, но ни одно из них, похоже, не работает.
Можно ли как-то исключить его из участия в classpath?