-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradle plugin is no longer compatible with Kotlin 2.0.0 and by Dependency Management Plugin #7384
Comments
We don't want or need the Kotlin version to be overridden on all configurations. We just need the If you apply the config you've provided then you're overriding all configurations. That's having an impact on Kotlin itself which is what the warning is about. There isn't much detekt can do about this directly. Your Gradle config needs to be fixed, or you need to stop the dependency plugin overriding the configs. |
But that is detekt official documentation https://detekt.dev/docs/gettingstarted/gradle/#dependencies, it's even in the logs of the warning.
But below Kotlin 2.0.0 this was working, so, what is the official way to do it now? The only real change in my gradle configuration is kotlin from 1.9.4 to 2.0.0. But the main problem with this is that you used to have a workaround with kotlin versions lower than 2.0.0 described in your own configuration, which is not working anymore. |
reading #6198 more in detail, I tried this: configurations.matching { it.name == "detekt" }.all {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.kotlin") {
useVersion(io.gitlab.arturbosch.detekt.getSupportedKotlinVersion())
}
}
} With that the project is fixed. So instead of using I think (maybe it's just me) the documentation on https://detekt.dev/docs/gettingstarted/gradle/#dependencies should be updated to precise that configuration as an example, or I need to learn how to read better. Thanks anyway for your help, and for this project. |
Can you provide a PR fixing the documentation? |
Expected Behavior
The current approach for mismatching versions of your project and the embedded one in detekt (in the context of Gradle runtime dependencies) is described here:
https://detekt.dev/docs/gettingstarted/gradle/#dependencies.
This was working in all versions except 2.0.0
With this prior 2.0.0 you fix the message like when you build your project:
detekt was compiled with Kotlin 1.8.0 but is currently running with 1.7.0
Observed Behavior
With the same approach in kotlin 2.0.0 with the configuration, the
:compileKotlin
task now fails with this message:Steps to Reproduce
I create this repo with the
main
branch having the bug inkotlin 2.0.0
and theolderexample
branch with this working inkotlin 1.9.4
, both withdetekt 1.23.6
Context
I'm trying to run detekt with Gradle in Kotlin 2.0.0 wit spring boot, but breaks the compilation of the project.
Can be related or duplicated from: #7304
Your Environment
--scan
option when running the gradle task):The text was updated successfully, but these errors were encountered: