元数据格式
原文:https://docs.spring.io/spring-boot/specification/configuration-metadata/format.html (Spring Boot 4.2.0)
配置元数据文件位于 jar 内的 META-INF/spring-configuration-metadata.json。它们使用 JSON 格式,项目分类为 groups(组)或 properties(属性),额外的值提示分类为 hints,忽略项分类为 ignored:
{"groups": [ { "name": "server", "type": "org.springframework.boot.web.server.autoconfigure.ServerProperties", "sourceType": "org.springframework.boot.web.server.autoconfigure.ServerProperties" } ], "properties": [ { "name": "server.port", "type": "java.lang.Integer", "sourceType": "org.springframework.boot.web.server.autoconfigure.ServerProperties", "defaultValue": 8080 } ]}
Group 属性
组用于分组,使用 name、type、sourceType、description 等属性描述。
Property 属性
属性包含 name、type、sourceType、defaultValue、description、deprecation(弃用信息)等字段。
Hint 属性
提示通过 name 和 values 为属性提供候选值列表。
Ignored 属性
ignored 列表指定应忽略的属性名。
重复的元数据项
同一个属性或组可以在多个元数据文件中定义,IDE 会合并它们。