🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 附录B.1. 元数据格式 配置元数据位于jars文件中的`META-INF/spring-configuration-metadata.json`,它们使用一个具有"groups"或"properties"分类节点的简单JSON格式: ```javascript {"groups": [ { "name": "server", "type": "org.springframework.boot.autoconfigure.web.ServerProperties", "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties" }, { "name": "spring.jpa.hibernate", "type": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate", "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties", "sourceMethod": "getHibernate()" } ... ],"properties": [ { "name": "server.port", "type": "java.lang.Integer", "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties" }, { "name": "server.servlet-path", "type": "java.lang.String", "sourceType": "org.springframework.boot.autoconfigure.web.ServerProperties", "defaultValue": "/" }, { "name": "spring.jpa.hibernate.ddl-auto", "type": "java.lang.String", "description": "DDL mode. This is actually a shortcut for the \"hibernate.hbm2ddl.auto\" property.", "sourceType": "org.springframework.boot.autoconfigure.orm.jpa.JpaProperties$Hibernate" } ... ],"hints": [ { "name": "spring.jpa.hibernate.ddl-auto", "values": [ { "value": "none", "description": "Disable DDL handling." }, { "value": "validate", "description": "Validate the schema, make no changes to the database." }, { "value": "update", "description": "Update the schema if necessary." }, { "value": "create", "description": "Create the schema and destroy previous data." }, { "value": "create-drop", "description": "Create and then destroy the schema at the end of the session." } ] } ]} ``` 每个"property"是一个配置节点,用户可以使用特定的值指定它。例如,`server.port`和`server.servlet-path`可能在`application.properties`中如以下定义: ```text server.port=9090 server.servlet-path=/home ``` "groups"是高级别的节点,它们本身不指定一个值,但为properties提供一个有上下文关联的分组。例如,`server.port`和`server.servlet-path`属性是`server`组的一部分。 **注**:不需要每个"property"都有一个"group",一些属性可以以自己的形式存在。