spring cloud配置文件

来源:互联网 发布:南京润和软件 编辑:程序博客网 时间:2024/05/21 17:05

spring cloud 的配置文件是application.properties,还有另外一种配置方式,使用application.yml文件配置。

application.yml的配置是根据父子树关系配置的,子节点需要在父节点下并缩进,否则会被认为是同一级。

如:在application.properties中配置:

erueka.client.serviceUrl.defaultZone:http://localhost:8761/eureka/

server.port:8764

spring.application.name:service-ribbon

      但是在application.yml中配置:

eureka:  client:    serviceUrl:      defaultZone: http://localhost:8761/eureka/server:  port: 8764spring:  application:    name: service-ribbon

原创粉丝点击