Spring Boot和Maven如何维护依赖版本?

huangapple go评论102阅读模式
英文:

How springboot and maven maintain the dependency version?

问题

例如,我想升级jackson-databind版本。使用下面的pom.xml,版本升级到2.15.2,但是我没有定义jackson-databind的版本,只定义了jackson-bom.version。Spring Boot是如何维护它的?即使与Spring相关的jackson版本升级到2.15.2。

想了解原理。

英文:

For example, I want to upgrade the jackson-databind version. With below pom.xml, the version upgrade to 2.15.2, however I do not define the version of jackson-databind. Only define the jackson-bom.version. How springboot maintain it? Even related jackson version of spring upgrade to 2.15.2.


    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.1.0</version>
    </parent>

    <properties>
        <jackson-bom.version>2.15.2</jackson-bom.version>
    </properties>


    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
    </dependencies>

enter image description here

Want to know the principle

答案1

得分: 0

BOM是一个特殊的POM文件,它将已知有效且经过测试可以一起使用的依赖版本进行分组 - Maven中的BOM。Jackson BOM包含了一套完整的一致版本的jackson依赖 - Jackson BOM

英文:

The BOM is a special POM file that groups dependency versions that are known to be valid and tested to work together - BOM in maven. Jackson BOM contains a complete set of consistent versions of jackson dependencies - Jackson BOM

huangapple
  • 本文由 发表于 2023年8月8日 20:05:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/76859389.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定