Skip to content

Commit 7066b37

Browse files
committed
Fix detekt failing on JVM 21
detekt 1.22.0 only accepts jvmTarget up to 18, so it fails when Gradle runs on Java 21. Explicitly setting jvmTarget = "11" on the Detekt tasks matches the project's configured Kotlin target and unblocks the check. detekt 1.23.x would fix this properly but requires Kotlin 1.9+, which is a separate upgrade.
1 parent 6b8823d commit 7066b37

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ configure(
8686
tasks.withType<Copy> {
8787
duplicatesStrategy = DuplicatesStrategy.INCLUDE
8888
}
89+
tasks.withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
90+
jvmTarget = "11"
91+
}
8992

9093
// Parallel build execution
9194
tasks.test {

0 commit comments

Comments
 (0)