This message was deleted.
# community-support
s
This message was deleted.
v
Use a build
--scan
, or the output of the
dependencyInsight
and
dependencies
tasks to find out where the version is coming from. Besides that, you shouldn't exclude it on
cms
and declare the dependency just to upgrade it. Only declaring it with higher number would be enough as conflict resolution picks the higher number. But even that would be unclean if you don't use okhttp in your own code. To just upgrade the transitive dependency, you would simply declare a constraint instead.
l
Now I have identified that in my dependencies, it has been overridden by the spring-boot dependencies. Here is the relevant code:
Copy code
groovy
plugins {
    id "org.springframework.boot" version "3.1.1" apply false
    id 'io.spring.dependency-management' version '1.1.2' apply false
    id 'java'
}
Upon inspecting the spring-boot dependencies https://github.com/spring-projects/spring-boot/blob/v3.1.1/spring-boot-project/spring-boot-dependencies/build.gradle, it appears as follows:
Copy code
groovy
library("OkHttp", "4.10.0") {
    group("com.squareup.okhttp3") {
        imports = [
            "okhttp-bom"
        ]
    }
}
Consequently, when running
gradle dependencies
, the output shows:
Copy code
|    +--- com.squareup.okhttp3:okhttp:4.12.0 -> 4.10.0 (*)
Is there a more elegant solution to address this situation? Thank you 🙏
v
Yes, don't use that shit 🙂
The Spring dependency management plugin is an obsolete relict from times when Gradle did not have built-in BOM support. It is very aggressive in even overriding strict version constraints, ports over some conceptually broken logic from Maven world into Gradle world, and by now does more harm than good. And its effect is also not nicely visible and clear in things like the
dependencies
task, the
dependencyInsight
task, or a build
--scan
. Even the maintainer of that plugin recommends not to use it anymore, but instead to use the built-in BOM support using
platform(...)
. So remove that plugin and instead use the built-in BOM support, it is also documented in the Spring Boot documentation how to do it.
🙌 1
l
OK,I understand, thank you very much😂
👌 1