spring-boot - 使用 "implementation platform(..."代替 io.spring.dependency-management gradle 插件中的 dependencyManagement 有什么区别

标签 spring-boot gradle

使用io.spring.dependency-management gradle插件的dependencyManagement与使用“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")
  ...
}

最佳答案

有一些关于 this GitHub issue 中差异的讨论。总而言之,在功能方面最显着的两个区别是依赖管理插件:

  1. 允许覆盖 bom 中的属性,以轻松控制多个托管依赖项的版本。
  2. 按照 Maven 的预期应用在依赖项的 pom 中声明的排除项。

性能方面最显着的差异是 Gradle 的 platformenforcedPlatform 支持应该明显更高效。作为依赖管理插件的主要作者,除非您想利用覆盖版本属性的功能,否则我鼓励您使用 Gradle 的 platformenforcedPlatform 支持.

关于spring-boot - 使用 "implementation platform(..."代替 io.spring.dependency-management gradle 插件中的 dependencyManagement 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76540095/

相关文章:

android - 如何在Gradle Android中更改MavenLocal路径

java - Gradle bootrun 因 openjdk 11 失败

android - Gradle 定义了多个 dex 文件

java - Spring异常处理程序,无法访问请求属性

java - Spring Boot Oauth2 扩展 DefaultTokenServices

java - Spring 启动: only discover JPA entity in test profile

gradle - 跳过gradle中的任务,但仅当任务存在时

java - Springboot 托管 GraphQL Server 不接受内容类型为 "application/json; charset=UTF-8"的查询

java - spring.datasource.username 和 spring.datasource.data-username 之间的区别

android - 用aapt2解析资源