Trying to solve the infamous SLF4J multiple bindings issue on Gradle. There are about a million solutions for Maven on here but none of them are translating to Gradle (not a Gradle expert obviously). I've tried a handful of solutions involving configurations
however none have worked correctly. Here is there error I'm getting (as I mentioned I'm trying to suppress the warnings)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:~/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-nop/1.7.22/3a4392836f875995446373b008e39cdb9a532fbe/slf4j-nop-1.7.22.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:~/.gradle/caches/modules-2/files-2.1/org.apache.logging.log4j/log4j-slf4j-impl/2.7/382b070836b8940a02d28c936974db95e9bfc3a4/log4j-slf4j-impl-2.7.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.helpers.NOPLoggerFactory]
This is the only SLF4J dependency in my project:
dependencies {
compile group: 'org.slf4j', name: 'slf4j-nop', version: '1.7.+'
...
}
Also, I'm running into the issue when I run my unit tests if that helps.
UPDATE: Figured out one of the dependencies is using org.apache.logging which in turn uses SLF4J. If I exclude the group for the apache logger the entire program fails because that dependency throws a ClassNotFoundException
. So now what?