https://kotlinlang.org logo
#detekt
Title
# detekt
d

dix

04/18/2022, 5:44 PM
has anyone noticed issues with
jvmTarget
when attempting to upgrade to
1.20.0
? when I upgrade the version, now all my detekt tasks fail with
Invalid value passed to --jvm-target
I've tried adding
Copy code
tasks.withType(Detekt).configureEach {
    jvmTarget = "1.8"
}
and that fails with
Could not get unknown property 'Detekt'
e

eygraber

04/18/2022, 6:51 PM
Are you specifying a
toolsVersion
?
d

dix

04/18/2022, 7:25 PM
i am not
e

eygraber

04/18/2022, 7:50 PM
What version of Kotlin are you using?
d

dix

04/18/2022, 8:12 PM
1.5.31
i see that is not recommended for detekt 1.20 but 1.20.0-RC2 worked with this kotlin version; so i'm surprised
e

eygraber

04/18/2022, 8:15 PM
I solved this for myself by updating to 1.6.20 but that was because I was explicitly setting
jvmTarget
to 17. I'm not as familiar with the groovy DSL, so I don't know why you're getting that error, but you're probably heading in the right direction by trying to set
jvmTarget
129 Views