Skip to content

Commit bef5e73

Browse files
committed
Exclude ktlint configurations from strict version conflict checking
The `ktlint` plugin (v14.1.0) introduces internal version conflicts between transitive dependencies (e.g., `sarif4k` 0.5.0 vs 0.6.0 and `kotlin-logging` 5.1.0 vs 7.0.3) when resolving its reporter and tool configurations. Since these conflicts are internal to the linting tool and do not affect the project's production runtime, this change bypasses the global `failOnVersionConflict()` strategy for any configuration starting with 'ktlint'. This allows Gradle's default conflict resolution to pick a functional version and fixes the `loadKtlintReporters` task failure. Signed-off-by: Junie <junie@jetbrains.com>
1 parent 1838106 commit bef5e73

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ val dependencyGroupVersions = mapOf<String, String>(
3232

3333
subprojects {
3434
configurations.all {
35-
resolutionStrategy {
36-
failOnVersionConflict()
37-
force(dependencyVersions)
38-
eachDependency {
39-
val forcedVersion = dependencyGroupVersions[requested.group]
40-
if (forcedVersion != null) {
41-
useVersion(forcedVersion)
35+
if (!name.startsWith("ktlint")) {
36+
resolutionStrategy {
37+
failOnVersionConflict()
38+
force(dependencyVersions)
39+
eachDependency {
40+
val forcedVersion = dependencyGroupVersions[requested.group]
41+
if (forcedVersion != null) {
42+
useVersion(forcedVersion)
43+
}
4244
}
4345
}
4446
}

0 commit comments

Comments
 (0)