From 635e15b8d46a48face458e4fe548e6267bf5d0e3 Mon Sep 17 00:00:00 2001 From: Artur Bosch Date: Tue, 19 Dec 2023 23:30:58 +0100 Subject: [PATCH] Workaround transitive logging classloader problem by constraining the dependency to a newer fixed version - #501 --- build.gradle.kts | 6 ++++++ gradle/libs.versions.toml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 15c3f2e..ccee5ef 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,6 +17,12 @@ plugins { } dependencies { + constraints { + runtimeOnly(libs.slf4j.api) { + because("transitive ktlint logging dependency (2.0.3) does not use the module classloader in ServiceLoader") + } + } + implementation(libs.detekt.api) implementation(libs.detekt.tooling) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index be3a0aa..30f6348 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,6 +5,7 @@ detektIJ = "2.2.0" assertj = "3.24.2" junit5 = "5.10.0" junit5Platform = "1.10.0" +slfApi = "2.0.9" [libraries] detekt-core = { group = "io.gitlab.arturbosch.detekt", name = "detekt-core", version.ref = "detekt" } @@ -16,6 +17,7 @@ detekt-testUtils = { group = "io.gitlab.arturbosch.detekt", name = "detekt-test- assertj-core = { group = "org.assertj", name = "assertj-core", version.ref = "assertj" } junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit5" } junit-platform = { group = "org.junit.platform", name = "junit-platform-launcher", version.ref = "junit5Platform" } +slf4j-Api = { module = "org.slf4j:slf4j-api", version.ref = "slfApi"} [plugins] kotlin-jvm = "org.jetbrains.kotlin.jvm:1.9.20"