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. SSO单点登录之Asp.Net实现示例

    一.什么是单点登录SSO(Single Sign-On) SSO是一种统一 认知 和授权机制,指访问用同一服务器不同应用中的受保护资源的同一用户,只需登录一次,即通过一个应用中的安全验证 后,再访问其 ...

  2. Spring Scheduler定时任务 + Quartz

    原文地址: https://blog.csdn.net/revitalizing/article/details/61420556 版权声明:本文为博主原创文章,未经博主允许不得转载. https:/ ...

  3. swift3.0:sqlite3的使用

    介绍 一.sqlite是纯C语言中底层的数据库,在OC和Swift中都是经常使用的数据库,在开发中,可以使用代码创建数据库,可以使用图形化界面创建数据库.例如SQLiteManager.SQLiteS ...

  4. [leetcode]Interleaving String @ Python

    原题地址:https://oj.leetcode.com/problems/interleaving-string/ 题意: Given s1, s2, s3, find whether s3 is ...

  5. 使用MDS Switch基本命令的一个例子

    笔者有幸摆弄一套vBlock的环境, 刚刚接手, 对其上的很多配置都不了解. 下面我们就例举一下我们通过运行哪些命令来搞清楚我们的UCS是如何连接到VNX storage array上的. 首先, 通 ...

  6. 深入理解Javascript window对象

    首先看我们的源代码. <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> ...

  7. iOS中的多线程 NSOperation

    在ios中,使用多线程有三种方式,分别是:NSThread.NSOperation和NSOperationQueue.GCD,在本节,主要讲解一下NSOperation的使用. NSOperation ...

  8. Nginx网站常见的跳转配置实例

    相信大家在日常运维工作中如果你用到nginx作为前端反向代理服务器的话,你会对nginx的rewrite又爱又恨,爱它是因为你搞定了它,完成了开发人员的跳转需求后你会觉得很爽,觉得真的很强大,恨它是因 ...

  9. hadoop2.2.0 centos 编译安装详解

    http://blog.csdn.net/w13770269691/article/details/16883663 废话不讲,直切正题. 搭建环境:Centos x 6.4 64bit 1.安装JD ...

  10. ssh tunnel

    https://peppoj.net/2012/10/tunnel-http-traffic-encrypted-using-polipo-and-ssh/ --------------------- ...