rcocco
V2EX  ›  Java

Spring Boot 各种配置的官方手册从哪里查?

  •  
  •   rcocco · Apr 28, 2023 · 2813 views
    This topic created in 1109 days ago, the information mentioned may be changed or developed.

    初学 Spring Boot 框架,有好多依赖我都不知道它在 application.yml 里有哪些配置能用,例如 spring-boot-starter-data-redis ,一些博客和文章了有介绍一小部分配置,我想知道所有的可用配置,不知道该从哪查。

    在官网 Spring.ioReference 里找了半天也没有。

    所以 Spring Boot 框架有没有那种大而全的官方手册?就像 Python Documentation 这样的

    6 replies    2023-04-30 15:17:01 +08:00
    Tengdw
        1
    Tengdw  
       Apr 28, 2023
    在引入的 starter 包里面找 @AutoConfiguration 注解的文件和 xxxProperties 的文件,大部分作者都会给配置项写注释说明的
    rb6221
        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
    sorcerer
        4
    sorcerer  
       Apr 28, 2023 via Android
    以前只能去找官方文档翻,现在我都问 chatgpt 了
    yuanxiaosong
        5
    yuanxiaosong  
       Apr 28, 2023
    另一种方法,打开 spring-boot-autoconfigure 这个依赖包,找到具体的包“package org.springframework.boot.autoconfigure.data.redis”,你会发现有个前缀“@ConfigurationProperties(prefix = "spring.redis")”,用“spring.redis”去对应文档里面查就好了。
    rcocco
        6
    rcocco  
    OP
       Apr 30, 2023
    @yuanxiaosong 感谢,官网那个指向最新版的链接 /docs/current/reference 是没有的,没想到在旧版手册里。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1002 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 22:17 · PVG 06:17 · LAX 15:17 · JFK 18:17
    ♥ Do have faith in what you're doing.