Code Monkey home page Code Monkey logo

Comments (5)

vcruzmj avatar vcruzmj commented on August 23, 2024 1

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 configurations.all { I should use configurations.matching { it.name == "detekt" }.all {

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.

from detekt.

BraisGabin avatar BraisGabin commented on August 23, 2024 1

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.

Can you provide a PR fixing the documentation?

from detekt.

3flex avatar 3flex commented on August 23, 2024

We don't want or need the Kotlin version to be overridden on all configurations. We just need the detekt configuration to be left alone.

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.

from detekt.

vcruzmj avatar vcruzmj commented on August 23, 2024

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.

But that is detekt official documentation https://detekt.dev/docs/gettingstarted/gradle/#dependencies, it's even in the logs of the warning.

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 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.
And stopping the dependency plugin to override the configs is like stopping using spring, that is not an option. There is a full discussion of this #6198 (still open).

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.

from detekt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.