Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • briar briar
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 783
    • Issues 783
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • briar
  • briarbriar
  • Issues
  • #1974

Closed
Open
Created Mar 23, 2021 by Sebastian@sebkurDeveloper

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
Assignee
Assign to
Time tracking