Fork me on GitHub
#tools-deps
<
2019-07-20
>
steveb8n01:07:11

Q: has anyone seen and fixed this warning “SLF4J: Class path contains multiple SLF4J bindings.”

steveb8n01:07:42

for the life of me I can’t figure out how to add the deps exclusion correctly in deps.edn

Alex Miller (Clojure team)02:07:03

In the coordinate, add :exclusions [group/artifact]

steveb8n06:07:32

thanks but I need to know which dep to exclude. I should have been clearer in my question.

steveb8n06:07:53

here’s the warning I see

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/steve/.m2/repository/com/fzakaria/slf4j-timbre/0.3.13/slf4j-timbre-0.3.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/steve/.m2/repository/org/slf4j/slf4j-nop/1.7.7/slf4j-nop-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See  for an explanation.
SLF4J: Actual binding is of type [com.github.fzakaria.slf4j.timbre.TimbreLoggerFactory]

steveb8n06:07:01

I’m want to use timbre so this suggests I should exclude the slf4j-nop dep. when I examine my deps tree, that is a transitive dep from Clojure (via tools.deps). I can’t figure out how to exclude that completely, or if there’s a better way to do this?

dominicm08:07:07

@U0510KXTU something is wrong if your clojure depends on slf4j-nop

dominicm08:07:15

do you mean something other than org.clojure/clojure?

steveb8n08:07:23

let me double-check….

steveb8n08:07:48

quite right, it’s coming from datomic-free

dominicm08:07:13

datomic-free probably shouldn't depend on slf4j-nop, but yeah.

steveb8n08:07:53

but there’s two more: from tools.gitlibs and tools.deps

steveb8n08:07:08

I can’t see how they are getting in there

dominicm08:07:02

tools deps has a transitive slf4j dependency, which I've flagged up that it shouldn't have in https://clojure.atlassian.net/projects/TDEPS/issues/TDEPS-108?filter=allopenissues

🙏 4
steveb8n08:07:35

I take it back. the extra one comes as part of tools.deps

steveb8n08:07:10

is there a way to explicitely exclude that? maybe explicitely add tools.deps as a dep?

dominicm08:07:30

I think you just need to change your t.d.a dependency to have an exclusion of slf4j-nop?

steveb8n08:07:05

I didn’t have a t.d.a dep in my deps

dominicm08:07:26

Where's it coming from?

steveb8n08:07:34

I added one with the exlusion (same as datomic-free) but it’s still there for some reason. digging….

dominicm08:07:42

is this a cursive issue, i.e. does it not appear in clojure -Stree?

steveb8n08:07:10

I think it might be. good idea, I’ll check from the CLI

steveb8n08:07:17

quite right, not a problem from the CLI

dominicm08:07:54

I guess cursive is adding t.d.a to your deps for some reason?

steveb8n08:07:44

you legend! despite the presence in Cursive, the warning has gone at load time. that fixed it

steveb8n08:07:00

once again, you’ve helped me. thanks mate

steveb8n08:07:20

if you are at Clojutre, I’ll buy you a beer

dominicm08:07:06

Unfortunately not, I'm at Heart of Clojure though on the chance you are, I know you struggle to get up for the european ones. I'm sure my fellow JUXTers will enjoy the beer though 🙂

steveb8n08:07:26

I’ll pay it forward. I just listened to the Juxt-cast today and heard about XT20. might have to switch to that next year