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元素中指定的版本号

  • 相关阅读:
    Spring_配置 Bean(2)
    Spring_HelloWorld
    搭建 Spring 开发环境
    MongoDB快速入门(十三)- 聚合count、distinct和group
    缓存技术,封装好的缓存类
    HTTP协议详解
    C# 缓存技术
    Web Service 的工作原理
    webview长按保存图片
    android Webview 实现js调用java代码实现Activity跳转
  • 原文地址:https://www.cnblogs.com/halfisland/p/14693927.html
Copyright © 2011-2022 走看看