gradlex-org / jvm-dependency-conflict-resolution

Gradle plugin to improve Dependency Conflict Detection and Resolution
http://gradlex.org/jvm-dependency-conflict-resolution/
Apache License 2.0
52 stars 14 forks source link

Patch logback >= 1.3 to require slf4j >= 2.0, logback < 1.3 to require slf4j <= 1.7.x #122

Open tbroyer opened 7 months ago

tbroyer commented 7 months ago

Slf4j 2 is a major breaking change (uses ServiceLoader rather than "static binder mechanism"), and Logback migrated to Slf4j 2 in version 1.3.

When working on tests for a PR for #106, I could have had slf4j 2 with logback 1.2, and these are actually incompatible (https://slf4j.org/faq.html#changesInVersion200) so it would be great if the plugin could prevent such situations.

The documentation for Logback says versions <= 1.2 “[have] been deprecated for several years and [are] no longer actively developed”, so maybe existing tests should just upgrade to slf4j 2 and logback 1.3 or 1.5 (depending on JDK requirements, maybe 1.5 and JDK 11 are OK for tests), or maybe they should be duplicated for slf4j 1.7 (with logback 1.2) and slf4j 2.0 (with logback 1.3 or 1.5).

ljacomet commented 6 months ago

Indeed, full support for slf4j 2 was never added. I still need to take a look at your PR.