导入坐标

    1. <dependency>
    2. <groupId>org.springframework.boot</groupId>
    3. <artifactId>spring-boot-configuration-processor</artifactId>
    4. <optional>true</optional>
    5. </dependency>

    程序编译后,在target->classes-> META-INF目录中会生成spring-configuration-metadata.json文件,然后拷贝生成出的文件到自己开发的META-INF目录中

    {
      "groups": [
        {
          "name": "nthink.swagger",
          "type": "com.nthink.his.swagger2.SwaggerProperties",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        },
        {
          "name": "nthink.swagger.contact",
          "type": "com.nthink.his.swagger2.SwaggerProperties$Contact",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties",
          "sourceMethod": "getContact()"
        }
      ],
      "properties": [
        {
          "name": "nthink.swagger.base-package",
          "type": "java.lang.String",
          "description": "swagger会解析的包路径",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        },
        {
          "name": "nthink.swagger.contact.email",
          "type": "java.lang.String",
          "description": "联系人email",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact"
        },
        {
          "name": "nthink.swagger.contact.email",
          "type": "java.lang.String",
          "description": "联系人email",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact",
          "defaultValue": ""
        },
        {
          "name": "nthink.swagger.contact.email",
          "type": "java.lang.String",
          "description": "联系人email",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact"
        },
        {
          "name": "nthink.swagger.contact.email",
          "type": "java.lang.String",
          "description": "联系人email",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact",
          "defaultValue": ""
        },
        {
          "name": "nthink.swagger.contact.name",
          "type": "java.lang.String",
          "description": "联系人",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact"
        },
        {
          "name": "nthink.swagger.contact.name",
          "type": "java.lang.String",
          "description": "联系人",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact",
          "defaultValue": ""
        },
        {
          "name": "nthink.swagger.contact.name",
          "type": "java.lang.String",
          "description": "联系人",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact"
        },
        {
          "name": "nthink.swagger.contact.name",
          "type": "java.lang.String",
          "description": "联系人",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact",
          "defaultValue": ""
        },
        {
          "name": "nthink.swagger.contact.url",
          "type": "java.lang.String",
          "description": "联系人url",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact"
        },
        {
          "name": "nthink.swagger.contact.url",
          "type": "java.lang.String",
          "description": "联系人url",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact",
          "defaultValue": ""
        },
        {
          "name": "nthink.swagger.contact.url",
          "type": "java.lang.String",
          "description": "联系人url",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact"
        },
        {
          "name": "nthink.swagger.contact.url",
          "type": "java.lang.String",
          "description": "联系人url",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties$Contact",
          "defaultValue": ""
        },
        {
          "name": "nthink.swagger.description",
          "type": "java.lang.String",
          "description": "描述",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        },
        {
          "name": "nthink.swagger.enabled",
          "type": "java.lang.Boolean",
          "description": "是否开启swagger",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        },
        {
          "name": "nthink.swagger.license",
          "type": "java.lang.String",
          "description": "许可证",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        },
        {
          "name": "nthink.swagger.license-url",
          "type": "java.lang.String",
          "description": "许可证URL",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        },
        {
          "name": "nthink.swagger.terms-of-service-url",
          "type": "java.lang.String",
          "description": "服务条款URL",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        },
        {
          "name": "nthink.swagger.title",
          "type": "java.lang.String",
          "description": "标题",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        },
        {
          "name": "nthink.swagger.version",
          "type": "java.lang.String",
          "description": "版本",
          "sourceType": "com.nthink.his.swagger2.SwaggerProperties"
        }
      ],
      "hints": []
    }
    

    测试提示