zoukankan      html  css  js  c++  java
  • springboot相关

    1.初试了下springboot,发现dependency都无需指定jar包版本。

    spring boot 在定义pom的时候,会引入一个parent:

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

    而这个spring boot starter parent 又指定了:

    <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>1.4.4.RELEASE</version>
            <relativePath>../../spring-boot-dependencies</relativePath>
        </parent>

    spring-boot-dependencies中定义了<dependencyManagement>,

     其中定义了一系列的依赖及其版本

    <dependencyManagement>
            <dependencies>
                <!-- Spring Boot -->
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot</artifactId>
                    <version>1.4.4.RELEASE</version>
                </dependency>
                    </dependencies>
    </dependencyManagement>

    那 dependencyManagement有什么用呢?

    我们通过它的元素来管理jar包的版本,让子项目中引用一个依赖而不用显示的列出版本号。Maven会沿着父子层次向上走,直到找到一个拥有dependencyManagement元素的项目,然后它就会使用在这个dependencyManagement元素中指定的版本号

  • 相关阅读:
    UVAlive5135_Mining Your Own Business
    UVAlive3523_Knights of the Round Table
    UVA10759_Dice Throwing
    POJ3177_Redundant Paths
    UVA11027_Palindromic Permutation
    Codechef_JULY14
    UVAlive4255_Guess
    UVA10054_The Necklace
    杜教BM
    【2018徐州网络赛】Morgana Net (矩阵快速幂)
  • 原文地址:https://www.cnblogs.com/halfisland/p/14693927.html
Copyright © 2011-2022 走看看