Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference of using "implementation platform(..." instead of dependencyManagement from io.spring.dependency-management gradle plugin

What is the difference of using dependencyManagement of the io.spring.dependency-management gradle plugin instead of using "implementation platform(..."?

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:2022.0.3"
    }
}

dependencies {
  implementation platform("org.springframework.cloud:spring-cloud-dependencies:2022.0.3")
  ...
}
like image 888
sge Avatar asked Oct 30 '25 05:10

sge


1 Answers

There's some discussion about the differences in this GitHub issue. To summarise, the two most notable differences in terms of features are that the dependency management plugin:

  1. Allows properties in a bom to be overridden to easily control the version of multiple managed dependencies.
  2. Applies exclusions declared in a dependency's pom as Maven intended.

The most notable difference in terms of performance is that Gradle's platform and enforcedPlatform support should be noticeably more efficient. Speaking as the main author of the dependency management plugin, unless you want to make use of the ability to override version properties, I would encourage you to use Gradle's platform and enforcedPlatform support.

like image 195
Andy Wilkinson Avatar answered Nov 03 '25 00:11

Andy Wilkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!