为什么在Spring Boot项目中不需要为某些依赖项指定版本?

我正在学习有关Spring Boot的知识,我发现您不需要为某些依赖项指定版本,但是需要为其他依赖项指定版本。此依赖项的版本从何而来?

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.dgs</groupId>
    <artifactId>n-tier-and-jackson</artifactId>
    <version>0.0.1-snAPSHOT</version>
    <name>n-tier-and-jackson</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>1.8</java.version>
        <paypal.rest.easy.version>2.3.3-RELEASE</paypal.rest.easy.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jersey</artifactId>
        </dependency>

        <dependency>
            <groupId>com.paypal.springboot</groupId>
            <artifactId>resteasy-spring-boot-starter</artifactId>
            <version>${paypal.rest.easy.version}</version>
        </dependency>

...

例如,在此代码中,您无需指定spring-boot-starter-jersey的版本,但是您需要指定resteasy-spring-boot-starter的版本。 spring-boot-starter-jersey的版本从何而来?谢谢!

huan325 回答:为什么在Spring Boot项目中不需要为某些依赖项指定版本?

依赖性版本在pom文件的父部分中指定的pom文件中声明

本文链接:https://www.f2er.com/3128443.html

大家都在问