SpringBoot 2.x:https://github.com/spring-projects/spring-boot/blob/2.0.x/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

1、详见:http://docs.spring.io/spring-boot/docs/1.5.2.RELEASE/reference/htmlsingle/#common-application-properties

2、上面文件的另外一个版本:https://github.com/spring-projects/spring-boot/blob/v1.5.2.RELEASE/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

官方文档上是这么说明这个属性列表的:

注:属性可以来自classpath下的其他jar文件中, 所以你不应该把它当成详尽的列表。 定义你自己的属性也是相当合法的。

注:示例文件只是一个指导。 不要拷贝/粘贴整个内容到你的应用, 而是只提取你需要的属性

3、上面这个链接只是列举的部分常用的属性项,完整的配置在:spring-boot-autoconfigure-xxx.jar里的xxx模块下的XXProperties.java里。

完整的列表:https://github.com/spring-projects/spring-boot/tree/v1.5.2.RELEASE/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure

这里拿redis举例:

https://github.com/spring-projects/spring-boot/blob/v1.5.2.RELEASE/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/RedisProperties.java

这个对象里的属性就为可以配置的所有的属性。

摘取上面那个RedisProperties.java文件里的部分代码:

package org.springframework.boot.autoconfigure.data.redis;

import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
* Configuration properties for Redis.
*
* @author Dave Syer
* @author Christoph Strobl
* @author Eddú Meléndez
* @author Marco Aust
*/
@ConfigurationProperties(prefix = "spring.redis")
public class RedisProperties { /**
* Database index used by the connection factory.
*/
private int database = 0; /**
* Redis url, which will overrule host, port and password if set.
*/
private String url; /**
* Redis server host.
*/
private String host = "localhost"; /**
* Login password of the redis server.
*/
private String password; /**
* Redis server port.
*/
private int port = 6379; /**
* Enable SSL.
*/
private boolean ssl; /**
* Connection timeout in milliseconds.
*/
private int timeout; //...........................
}

SpringBoot常用属性配置的更多相关文章

  1. SpringBoot项目属性配置-第二章

    SpringBoot入门 1. 相信很多人选择Spring Boot主要是考虑到它既能兼顾Spring的强大功能,还能实现快速开发的便捷.我们在Spring Boot使用过程中,最直观的感受就是没有了 ...

  2. Hystrix 常用属性配置

    配置参数 默认值 说明 命令-执行属性配置 hystrix.command.default.execution.isolation.strategy THREAD 配置隔离策略,有效值 THREAD, ...

  3. spring boot学习(2) SpringBoot 项目属性配置

    第一节:项目内置属性 application.properties配置整个项目的,相当于以前的web.xml: 注意到上一节的访问HelloWorld时,项目路径也没有加:直接是http://loca ...

  4. SpringBoot项目属性配置

    如果使用IDEA创建Springboot项目,默认会在resource目录下创建application.properties文件,在SpringBoot项目中,也可以使用yml类型的配置文件代替pro ...

  5. springboot项目属性配置及注意事项

    在idea编辑器建的springboot项目中的resources包下的application.properties这个就是配置文件. 另外配置文件的文件名还可以是application.yml,在r ...

  6. SpringBoot常用数据源配置

    #mysql8.X url: jdbc:mysql://localhost:3306/yourdbname?serverTimezone=UTC&useSSL=false&allowP ...

  7. springboot学习笔记-2 一些常用的配置以及整合mybatis

    一.一些常用的配置 1.1 使用没有父POM的springboot 通过添加scope=import的依赖,仍然能获取到依赖管理的好处: <dependencyManagement> &l ...

  8. SpringBoot 入门篇(二) SpringBoot常用注解以及自动配置

    一.SpringBoot常用注解二.SpringBoot自动配置机制SpringBoot版本:1.5.13.RELEASE 对应官方文档链接:https://docs.spring.io/spring ...

  9. SpringBoot常用配置简介

    SpringBoot常用配置简介 1. SpringBoot中几个常用的配置的简单介绍 一个简单的Spring.factories # Bootstrap components org.springf ...

随机推荐

  1. Could not execute method of the activity Android

    导致此问题的原因有, 一:未注册 如果是 ActivityNotFoundException 的,那说明没在 Manifest.xml 的 application 标签下注册 activity. 二: ...

  2. java中 列表,集合,数组之间的转换

    java中 列表,集合,数组之间的转换 java中 列表,集合,数组之间的转换 java中 列表,集合,数组之间的转换 List和Set都是接口,它们继承Collection(集合),集合里面任何数据 ...

  3. 关于Base64编码的理解

    版权声明:本文为[viclee]原创,如需转载请注明出处~ https://blog.csdn.net/goodlixueyong/article/details/52132250 之前在很多业务中都 ...

  4. jQuery.data() 的实现方式,jQuery16018518865841457738的由来,jQuery后边一串数字的由来

    原文地址: http://xxing22657-yahoo-com-cn.iteye.com/blog/1042440 jQuery.data() 的实现方式 jQuery.data() 的作用是为普 ...

  5. Google和Baidu的站内搜索代码

    <!-- SiteSearch Google --> <form method="get" action="http://www.google.com/ ...

  6. 从零开始学C++之模板(三):缺省模板参数(借助标准模板容器实现Stack模板)、成员模板、关键字typename

    一.缺省模板参数 回顾前面的文章,都是自己管理stack的内存,无论是链栈还是数组栈,能否借助标准模板容器管理呢?答案是肯定的,只需要多传一个模板参数即可,而且模板参数还可以是缺省的,如下: temp ...

  7. 样条之埃尔米特(Hermite)插值函数

    核心代码: ////////////////////////////////////////////////////////////////////// // 埃尔米特等距插值 /////////// ...

  8. Mac-OSX下Ruby更新

    Mac下是自带Ruby环境的,在有些情况我们是需要更新Ruby的,安装和更新Ruby环境可以通过rvm命令进行操作,rvm在安装过程中通过HomeBrew安装依赖包,如果之前没有装过HomeBrew, ...

  9. Backbone.js 使用 Collection

    在前面我们的 Backbone.js 用上了 Model, 但绝大数的情况下我们处理的都是一批的 Model 数据列表,所以需要有一个 Collection 来容纳 Model, 就像 Java 里最 ...

  10. Android -- Camera2(Android5.0)

    Camera2 Camera2是Android5.0中的其中一个新的特性,新的API.与原来的camera API相比,不同之处在于: 原生支持RAW照片输出 突发拍摄模式 制约拍照速度的不再是软件而 ...