detekt: Using detekt Gradle plugin with Kotlin 1.3.71 causes NoClassDefFoundError
Expected Behavior
Upgrading from Kotlin 1.3.70 to Kotlin 1.3.71 should not have any effect on running detekt.
Observed Behavior
detekt starts to throw:
Caused by: java.lang.NoClassDefFoundError: kotlin/ExceptionsKt
at kotlin.io.CloseableKt.closeFinally(Closeable.kt:58)
at io.gitlab.arturbosch.detekt.cli.runners.Runner.execute(Runner.kt:30)
Steps to Reproduce
Check out the branch at https://github.com/oss-review-toolkit/ort/pull/2409 and run ./gradlew detekt
.
Context
Your Environment
- Version of detekt used: 1.7.0
- Version of Gradle used (if applicable): 6.2.2
- Operating System and version: Linux / Windows
- Link to your project (if it’s a public repository): https://github.com/oss-review-toolkit/ort
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (20 by maintainers)
Commits related to this issue
- Gradle: Upgrade the Kotlin plugin to version 1.3.72 See https://github.com/JetBrains/kotlin/blob/1.3.70/ChangeLog.md#1372. This requires to stop enforcing the kotlin-reflect version as otherwise the... — committed to oss-review-toolkit/ort by sschuberth 4 years ago
- Gradle: Upgrade the Kotlin plugin to version 1.3.72 See https://github.com/JetBrains/kotlin/blob/1.3.70/ChangeLog.md#1372. This requires to stop enforcing the kotlin-reflect version as otherwise the... — committed to oss-review-toolkit/ort by sschuberth 4 years ago
- Gradle: Upgrade Kotlin to version 1.4 See https://github.com/JetBrains/kotlin/releases/tag/v1.4.0. This restores forcing the "kotlin-reflect" version which was removed in a8cf286 for the wrong reaso... — committed to oss-review-toolkit/ort by sschuberth 4 years ago
- Gradle: Upgrade Kotlin to version 1.4 See [1]. Note that some Kotlin artifacts were renamed [2] so this change also accounts for that. This restores forcing the "kotlin-reflect" version which was re... — committed to oss-review-toolkit/ort by sschuberth 4 years ago
- Gradle: Upgrade Kotlin to version 1.4 See [1]. Besides the plain upgrade this commit includes the following necessary changes: - Remove a now unnecessary non-null assertion which would otherwise t... — committed to oss-review-toolkit/ort by sschuberth 4 years ago
We do have this “theoretically” fixed with our new
tooling
module (even practically in the new experimental https://github.com/detekt/detekt-compiler-plugin). However until Gradle Worker’s Api supports classpath caching our hands tied here if we do not want to loose performance.I have some further documentation in https://github.com/detekt/detekt/pull/2896.
TBH, I never noticed, as I a) never compared to using the CLI manually, and b) mostly leave running detekt to CI 😁
But still interesting if the slowdown was caused by classloader lookups!