
初学 Spring Boot 框架,有好多依赖我都不知道它在 application.yml 里有哪些配置能用,例如 spring-boot-starter-data-redis ,一些博客和文章了有介绍一小部分配置,我想知道所有的可用配置,不知道该从哪查。
在官网 Spring.io 的 Reference 里找了半天也没有。
所以 Spring Boot 框架有没有那种大而全的官方手册?就像 Python Documentation 这样的
1 Tengdw Apr 28, 2023 在引入的 starter 包里面找 @AutoConfiguration 注解的文件和 xxxProperties 的文件,大部分作者都会给配置项写注释说明的 |
2 rb6221 Apr 28, 2023 试试这样搜 spring-boot-starter-data-redis site:docs.spring.io 我搜了一下 结果在这里 https://docs.spring.io/spring-boot/docs/2.2.6.RELEASE/reference/html/using-spring-boot.html |
3 yuanxiaosong Apr 28, 2023 |
4 sorcerer Apr 28, 2023 via Android 以前只能去找官方文档翻,现在我都问 chatgpt 了 |
5 yuanxiaosong Apr 28, 2023 另一种方法,打开 spring-boot-autoconfigure 这个依赖包,找到具体的包“package org.springframework.boot.autoconfigure.data.redis”,你会发现有个前缀“@ConfigurationProperties(prefix = "spring.redis")”,用“spring.redis”去对应文档里面查就好了。 |
6 rcocco OP @yuanxiaosong 感谢,官网那个指向最新版的链接 /docs/current/reference 是没有的,没想到在旧版手册里。 |