特牛生活网

springboot读取yml配置文件_spring boot 读取 yml-CSDN博客

网友收藏
文章浏览阅读1.2k次。springboot读取yml配置文件里的属性到Java代码,一般有两种常用方式:使用注解@ConfigurationProperties批量读取使用注解@Value单个读取示例yml文件:data: elasticsearch: cluster-name: elasticsearch cluster-nodes: 192.168.1.135:9200 scheme: http maxRetry_Timeout_Millis: 60000 sock_spring boot 读取 yml