briar-headless: multiple SLF4J bindings on tests
When running the tests on the briar-headless
module, multiple bindings for SLF4J are found on the classpath, resulting in this warning:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/z/gitlab/briar/briar-swing/briar-headless/build/libs/briar-headless.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/z/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.26/dfb0de47f433c2a37dd44449c88d84b698cd5cf7/slf4j-simple-1.7.26.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.SimpleLoggerFactory]
It's not too bad as it's actually the same binding that's being found twice. However I was wondering, why this is the case and if there's something misconfigured. I took a look and my analysis is: briar-headless builds a fat jar with all the dependencies included (including slf4j) and for the tests both the fat jar as well as all the dependencies are put on the classpath. That means, we have everything twice on the classpath, not just the slf4j bindings.
I think it would be good to solve this somehow and the solution would probably be to fix the classpath of the tests. Either
- (A) let the tests run with the non-fat (regular) headless jar plus dependencies, or
- (B) run it with the fat jar but exclude the dependencies from the testing classpath