简体   繁体   中英

Why you don't need to specify the version for some dependencies in Spring Boot project?

I'm learning about Spring Boot and I see that you don't need to specify the version for some dependencies, but you need to specify the version for other dependencies. Where does the version of this dependencies comes from?

    <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>

...

For example in this code you don't need to specify the version for spring-boot-starter-jersey, but you need to specify the version for resteasy-spring-boot-starter. Where does the version for spring-boot-starter-jersey comes from? Thank you!

Dependencies versions are declared in the pom file that you have specified in the parent section of your pom file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM