ljacomet / logging-capabilities

Apache License 2.0
40 stars 6 forks source link

Handle deprecated / renamed org.slf4j:jcl104-over-slf4j #16

Closed cslee00 closed 1 week ago

cslee00 commented 2 years ago

jcl104-over-slf4j is deprecated, having been renamed to org.slf4j:jcl-over-slf4j.

A resolution strategy such as the below substitutes any transitive occurrence (likely to occur in legacy solutions):

if (requested.name == "jcl104-over-slf4j") { useTarget("org.slf4j:jcl-over-slf4j:${libs.versions.slf4j.get()}") }

ljacomet commented 2 years ago

Thank you for your interest in this plugin.

I see indeed that this module existed a while ago - last release in 2009. Given how ancient it is, I wonder if this even makes sense to cover. Do you have a specific use case or issue caused by this plugin interacting with this module?

cslee00 commented 2 years ago

Current use case is modernizing a large legacy application, starting with the build script. As the app contains a large (100+) number of dependencies, it ends up transitively pulling in jcl104-over-slf4j which conflicts with jcl-over-slf4j (jcl104 supports commons logging 1.0.4, jcl supports commons logging 1.0.4+). Depending on class load order (ordering of the JARs) all manner of strange things occur.

While we can of course resolve this directly (the earlier code snippet was from exactly that), it's cleaner to have this resolved elsewhere as it helps with: a) remembering to reproduce this logic in each new sub-module that is introduced; b) remembering to reproduce this logic in subsequent projects that are being modernized; c) reducing the app-specifc logic/noise in the build script (and determining when this logic can safely be removed)

ljacomet commented 1 week ago

Replaced by: