à悟空学院:https://t.cn/Rg3fKJD
学院中有Spring Boot相关的课程!点击「阅读原文」进行查看!
SpringBoot视频:http://t.cn/A6ZagYTi
Spring Cloud视频:http://t.cn/A6ZagxSR
SpringBoot Shiro视频:http://t.cn/A6Zag7IV
SpringBoot交流平台:https://t.cn/R3QDhU0
SpringData和JPA视频:http://t.cn/A6Zad1OH
SpringSecurity5.0视频:http://t.cn/A6ZadMBe
Sharding-JDBC分库分表实战:http://t.cn/A6ZarrqS
分布式事务解决方案「手写代码」:http://t.cn/A6ZaBnIr
网易云课堂视频最新更新:
第十一章 Spring Boot 日志
1、spring boot日志—理论
2、Spring Boot日志-logback
3、Spring Boot日志-log4j2
第十二章 Spring Boot 知识点2
1、spring boot 服务配置和部署
2、Spring Boot 定制URL匹配规则
此文章转载地址:http://www.tuicool.com/articles/RJJvMj3 请注重作者的版权。
spring-boot通过maven的依赖管理为我们写好了很多依赖项及其版本,我们可拿来使用。spring-boot文档介绍了两种使用方法,一是继承,二是导入。
通过<parent>继承:
<project>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.9.RELEASE</version>
</parent>
</project>
或者在<dependencyManagement>中导入:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.1.9.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
此外,在其 文档 里说到,继承时可简单地通过属性定制依赖项版本。比如,改为使用较新的spring-4.1.6.RELEASE版本:
<properties>
<spring.version>4.1.6.RELEASE<spring.version>
</properties>
不过,此法只对继承有效,导入无效。以下摘自其文档说明:
This only works if your Maven project inherits (directly or indirectly) from spring-boot-dependencies. If you have added spring-boot-dependencies in your own dependencyManagement section with <scope>import</scope> you have to redefine the artifact yourself instead of overriding the property.
导入时有没有较简单的方法呢?我们可先继承后导入!
1、先建一个过渡性工程,继承后定制依赖项的版本。
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.1.9.RELEASE</version>
</parent>
<groupId>mycomp</groupId>
<artifactId>myproject-spring-boot-bom</artifactId>
<version>1.1.9</version>
<packaging>pom</packaging>
<properties>
<spring.version>4.1.6.RELEASE</spring.version>
</properties>
</project>
2、然后导入到自己的工程里。
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>mycomp</groupId>
<artifactId>myproject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>mycomp</groupId>
<artifactId>myproject-spring-boot-bom</artifactId>
<version>1.1.9</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
这样,虽然多建了一个过渡性工程,但定制依赖项版本同继承时一样简单。
【Spring Boot 系列博客】
49. spring boot日志升级篇—理论【从零开始学Spring Boot】
48. spring boot单元测试restfull API【从零开始学Spring Boot】
47. Spring Boot发送邮件【从零开始学Spring Boot】
46. Spring Boot中使用AOP统一处理Web请求日志
45. Spring Boot MyBatis连接Mysql数据库【从零开始学Spring Boot】
44. Spring Boot日志记录SLF4J【从零开始学Spring Boot】
43. Spring Boot动态数据源(多数据源自动切换)【从零开始学Spring Boot】
42. Spring Boot多数据源【从零开始学Spring Boot】
41. Spring Boot 使用Java代码创建Bean并注册到Spring中【从零开始学Spring Boot】
40. springboot + devtools(热部署)【从零开始学Spring Boot】
39.4 Spring Boot Shiro权限管理【从零开始学Spring Boot】
39.3 Spring Boot Shiro权限管理【从零开始学Spring Boot】
39.2. Spring Boot Shiro权限管理【从零开始学Spring Boot】
39.1 Spring Boot Shiro权限管理【从零开始学Spring Boot】
38 Spring Boot分布式Session状态保存Redis【从零开始学Spring Boot】
37 Spring Boot集成EHCache实现缓存机制【从零开始学Spring Boot】
36 Spring Boot Cache理论篇【从零开始学Spring Boot】
35 Spring Boot集成Redis实现缓存机制【从零开始学Spring Boot】
34Spring Boot的启动器Starter详解【从零开始学Spring Boot】
33 Spring Boot 监控和管理生产环境【从零开始学Spring Boot】
32 Spring Boot使用@SpringBootApplication注解【从零开始学Spring Boot】
31 Spring Boot导入XML配置【从零开始学Spring Boot】
30 导入时如何定制spring-boot依赖项的版本【转载】【从零开始学Spring Boot】
更多查看博客: http://412887952-qq-com.iteye.com/
相关推荐
从零开始学Spring Boot.pdf从零开始学Spring Boot.pdf从零开始学Spring Boot.pdf从零开始学Spring Boot.pdf从零开始学Spring Boot.pdf从零开始学Spring Boot.pdf从零开始学Spring Boot.pdf从零开始学Spring Boot.pdf...
1.33 导入时如何定制spring-boot依赖项的版本 1.34 Spring Boot导入XML配置 1.35 Spring Boot使用@SpringBootApplication注解 1.36 Spring Boot 监控和管理生产环境 1.37 Spring Boot的启动器Starter详解 1.38 ...
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2291500
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2299732
从零开始学Spring Boot。是学习spring Boot的起步资料!!
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2293846
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2292739
从零开始学springboot 适合小白学习 spring全家桶系列
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2291508
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2292471
从零开始学Spring Boot(Spring Boot技术文档)
1.7 (5)全局异常捕捉【从零开始学Spring Boot】 .23 1.15 (13)处理静态资源(默认资源映射)【从零开始学Spring Boot】 .4
从零开始Spring Boot,通过实战快速入门。Spring Boot不是一门新技术,所以不用紧张。从本质上来说,Spring Boot就是Spring,它做了那些没有它你也会去做的Spring Bean配置。它使用“习惯优于配置”(项目中存在大量...
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2317365
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2294942
NULL 博文链接:https://412887952-qq-com.iteye.com/blog/2295146