spring cloud & spring boot 全家桶 & maven 标签 dependencyManagement
2018-01-21 00:00
337 查看
摘要: dependencyManagement
这里使用的是Maven <dependencyManagement> 能更方便的管理子项目的公共的依赖。
为了项目的正确运行,必须让所有的子项目使用依赖项的统一版本,必须确保应用的各个项目的依赖项和版本一致,才能保证测试的和发布的是相同的结果。
在我们项目顶层的POM文件中,我们会看到dependencyManagement元素。通过它元素来管理jar包的版本,让子项目中引用一个依赖而不用显示的列出版本号。Maven会沿着父子层次向上走,直到找到一个拥有dependencyManagement元素的项目,然后它就会使用在这个dependencyManagement元素中指定的版本号。
就不需要再写版本号了
<dependencyManagement> <dependencies> <dependency> <!-- Import dependency management from Spring Boot --> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>1.5.9.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Dalston.SR1</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
这里使用的是Maven <dependencyManagement> 能更方便的管理子项目的公共的依赖。
为了项目的正确运行,必须让所有的子项目使用依赖项的统一版本,必须确保应用的各个项目的依赖项和版本一致,才能保证测试的和发布的是相同的结果。
在我们项目顶层的POM文件中,我们会看到dependencyManagement元素。通过它元素来管理jar包的版本,让子项目中引用一个依赖而不用显示的列出版本号。Maven会沿着父子层次向上走,直到找到一个拥有dependencyManagement元素的项目,然后它就会使用在这个dependencyManagement元素中指定的版本号。
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> </dependency>
就不需要再写版本号了
相关文章推荐
- springboot+thymeleaf 实现thymeleaf自定义方言系统 自定义标签, cms系统搭建(二)
- spring cloud + spring boot + ...分布式微服务云架构
- spring boot / cloud (十三) 404错误处理进阶
- springboot 继承shiro 使用redis缓存 @Value 标签无效 无法获取值
- SpringCloud SpringBoot mybatis 分布式微服务(十三)Spring Boot中使用MongoDB数据库
- 和spring cloud/boot 学习如何管理自己的组件
- Spring Boot和Spring Cloud架构学习(一)--Spring介绍
- Spring 5.0+Spring Boot+security+spring cloud oauth2+Redis整合详情,记录那些遇到的一些坑
- 基于SpringBoot 2.0正式版的SpringCloud的微服务实战项目搭建
- Spring Cloud Spring Boot mybatis分布式微服务云架构(一)快速入门
- 1 Springboot SpringCloud集成OAuth2入门详细教程
- 「一句话经典」从Spring到SpringMVC再到JavaEE开发颠覆者Spring Boot,最后佛法无边Spring Cloud;只不过却成了nodejs的笑柄
- Spring Cloud Spring Boot mybatis分布式微服务云架构(八)开发Web应用(2)
- 用Spring Boot & Cloud,Angular2快速搭建微服务web应用 - 实现RESTful CRUD
- Spring Cloud Spring Boot mybatis分布式微服务云架构(十六)使用JdbcTemplate操作数据库
- Spring Cloud全家桶主要组件及简要介绍
- Spring Boot + Spring Cloud 构建微服务系统(六):熔断监控集群(Turbine)
- Spring Boot + Spring Cloud 实现权限管理系统 后端篇(十九):服务消费(Ribbon、Feign)
- Spring全家桶系列–SpringBoot与Mybatis结合
- Spring Boot Shiro 权限信息缓存处理,记住我,thymleaf使用shiro标签