zoukankan      html  css  js  c++  java
  • springboot项目中如何在pom文件覆盖starter中默认指定的jar版本号

    分两种情况:

    1.项目继承自spring-boot-starter-parent 

        通过定义properties的方式改变starter中的默认版本

    <!-- Inherit defaults from Spring Boot -->
    <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.2.RELEASE</version>
    </parent>
    
    <properties>
    <spring-data-releasetrain.version>Fowler-SR2</spring-data-releasetrain.version>
    </properties>

       

     2.不继承spring-boot-starter-parent 

       在引入spring-boot-dependencies之前指定要覆盖的依赖,但要注意 type 和 scope属性

    <dependencyManagement>
     <dependencies>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-releasetrain</artifactId>
        <version>Fowler-SR2</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>     <!-- Import dependency management from Spring Boot -->     <groupId>org.springframework.boot</groupId>     <artifactId>spring-boot-dependencies</artifactId>     <version>2.1.2.RELEASE</version>     <type>pom</type>     <scope>import</scope>   </dependency> </dependencies> </dependencyManagement>
  • 相关阅读:
    JavaScript -- 条件语句和循环语句
    xpath的|
    Pythonic
    4k图片爬取+中文乱码
    xpath-房价爬取
    (.*?)实验室
    模块的循环导入
    bs4-爬取小说
    糗图-图片爬取
    re实战记录
  • 原文地址:https://www.cnblogs.com/hzhuxin/p/10343093.html
Copyright © 2011-2022 走看看