(三)Spring Boot 官网文档学习之默认配置
原文地址:https://docs.spring.io/spring-boot/docs/2.1.3.RELEASE/reference/htmlsingle/#using-boot
继承 spring-boot-starter-parent
当我们在 pom
里面继承 spring-boot-starter-parent
的时候,我们将自动的获得一些默认值,这些默认值都是 spring-boot-starter-parent
里面默认配置的;
一般都有下面默认值:
JDK8
将作为默认的编译器;- 所有的编码,都将自动的使用
UTF8
;
还有一些其他默认值,博主初学,暂时也不明白是什么意思,贴出原文,大家自己看看:
A Dependency Management section, inherited from the spring-boot-dependencies pom, that manages the versions of common dependencies. This dependency management lets you omit <version> tags for those dependencies when used in your own pom.
An execution of the repackage goal with a repackage execution id. Sensible resource filtering.
Sensible plugin configuration (exec plugin, Git commit ID, and shade).
Sensible resource filtering for application.properties and application.yml including profile-specific files (for example, application-dev.properties and application-dev.yml)
Note that, since the application.properties and application.yml files accept Spring style placeholders (${…}), the Maven filtering is changed to use @..@ placeholders. (You can override that by setting a Maven property called resource.delimiter.)
覆盖默认配置
继承默认配置以后,还是可以覆盖掉默认配置的;
我们只需要在 <properties>
里面配置,我们想要覆盖的属性的具体版本,即可:
例如,覆盖 spring-data-releasetrain
的默认版本:
<properties>
<spring-data-releasetrain.version>Fowler-SR2</spring-data-releasetrain.version>
</properties>
和上一篇,使用没有 <parent>
的 pom
,而使用 spring-boot-dependencies
一样,都可以覆盖默认配置;
启动器
启动器,可以理解为一组配置,被打包成一个依赖包了;
比如我们需要 Spring Framework
框架的缓存功能,则可以在 <dependencies>
里面添加 spring-boot-starter-cache
启动器 依赖;
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>
</dependencies>
官方的启动器名字格式都是 spring-boot-starter-*
,在 IDEA
配置好 Maven
以后,可以使用 Ctrl + 空格键
进行智能提示;
官网给出了启动器的列表,以及说明,地址 :Spring Boot 启动器
(三)Spring Boot 官网文档学习之默认配置的更多相关文章
- (四)Spring Boot官网文档学习
文章目录 关于默认包的问题 加载启动类 配置 Bean管理和依赖注入 @SpringBootApplication Developer Tools 关于 Developer Tools 的一些细节 原 ...
- (五)Spring Boot官网文档学习
文章目录 SpringApplication SpringApplication 事件 `ApplicationContext ` 类型 访问传递给 `SpringApplication` 的参数 A ...
- (二)Spring Boot 官网文档学习之入门
文章目录 Spring Boot 是什么 系统要求 Servlet 容器 Maven方式安装Spring Boot 编写第一个 Spring Boot 项目 原文:https://docs.sprin ...
- Spring Security 官网文档学习
文章目录 通过`maven`向普通的`WEB`项目中引入`spring security` 配置 `spring security` `configure(HttpSecurity)` 方法 自定义U ...
- Spring3.0官网文档学习笔记(四)--3.1~3.2.3
3.1 Spring IoC容器与Beans简单介绍 BeanFactory接口提供对随意对象的配置: ApplicationContext是BeanFactory的子接口.整合了Sp ...
- Spring3.0官网文档学习笔记(八)--3.4.3~3.4.6
3.4.3 使用depends-on 使用depends-on能够强制使一个或多个beans先初始化,之后再对这个bean进行初始化. 多个bean之间用","." ...
- Spring3.0官网文档学习笔记(一)
Part 1 Spring框架概述 Spring是模块化的,在应用中仅仅须要引入你所须要用到的模块的jar包,其余的jar包不用引入. spring框架支持声明式的事务管理,通过RMI或web ser ...
- Spring3.0官网文档学习笔记(七)--3.4.2
3.4.2 依赖与配置的细节 3.4.2.1 Straight values (primitives, Strings, and so on) JavaBeans PropertyE ...
- Spring3.0官网文档学习笔记(二)
1.3 使用场景 典型的成熟的spring web应用 spring使用第三方框架作为中间层 远程使用场景 EJB包装 1.3.1 依赖管理.命名规则(包) spring-*.jar *号代表 ...
随机推荐
- docker中部署django项目~~Dockfile方式和compose方式
1. 背景: 本机win10上,后端django框架代码与前端vue框架代码联调通过. 2. 目的: 在centos7系统服务器上使用docker容器部署该项目. 3. 方案一:仅使用基 ...
- ciscn2019华北赛区半决赛day1_web1题解
感谢buuoj的大佬们搭建的复现环境.作为一位CTF的初学者,我会把每个题目的writeup都写的尽量详细,希望能帮到后面的初学者. http://web42.buuoj.cn 文章会不定时继续完善, ...
- 团队作业-Alpha(1/4)
队名:软工9组 组长博客: https://www.cnblogs.com/cmlei/ 作业博客: 组员进度 ● 组员一(组长) 陈明磊 ○过去两天完成了哪些任务 ●文字/口头描述 初步学习flas ...
- Open vSwitch系列实验(三):Open vSwitch的VxLAN隧道网络实验
1 实验目的 该实验通过Open vSwitch构建Overlay的VxLAN网络,更直观的展现VxLAN的优势.在实验过程中,可以了解如何建立VxLAN隧道并进行配置,并实现相同网段和不同网段之间的 ...
- spring线程池的同步和异步(1)
spring线程池(同步.异步) 一.spring异步线程池类图 二.简单介绍 2.1. TaskExecutor---Spring异步线程池的接口类,其实质是java.util.concurrent ...
- Linux-IIC驱动(详解)
IIC接口下的24C02 驱动分析: http://www.cnblogs.com/lifexy/p/7793686.html 接下来本节, 学习Linux下如何利用linux下I2C驱动体系结构来操 ...
- nginx配置静态资源与动态访问分离【转】
在前面的博客中<说说 NGINX 的配置及优化>的 2.5 小节里面,提到 location 模块是 nginx 中用的最多的,也是最重要的模块,负载均衡.反向代理.虚拟域名等都与它相关. ...
- Gis基础知识,坐标 投影
1. 大地测量学 (Geodesy) 大地测量学是一门量测和描绘地球表面的学科,也包括确定地球重力场和海底地形. 1.1 大地水准面 (geoid) 大地水准面是海洋表面在排除风力.潮汐等其它影响,只 ...
- 数据库中的union与union all的区别
Union因为要进行重复值扫描,所以效率低.如果合并没有刻意要删除重复行,那么就使用Union All 两个要联合的SQL语句 字段个数必须一样,而且字段类型要“相容”(一致): 如果我们需要将两个 ...
- SQL Server 将查询结果集以XML形式展现 for xml path
for xml path,其实它就是将查询结果集以XML形式展现 双击打开