application.property文件方式和application.yml方式配置文件方式对比
一个是一字长蛇阵的配置,一个是这样分开的配置
注意:
分开的配置是有讲究的:
1.不同的等级之间用冒号隔开
2.次等级前面是空格不能用tab符
3.每一层的冒号后面如果有值,要用空格符号分开
这个配置文件中的一些具体的配置的用法:
spring:
mvc:
view:
prefix: /WEB-INF/jsp/
suffix: .jsp
server:
port: 8888
context-path: /test
对于git的一些注解:
spring.cloud.config.server.git.uri=https://github.com/how2j/trendConfig/ //配置git的仓库地址
spring.cloud.config.server.git.searchPaths=respo //表示目录
spring.cloud.config.server.default-label=master // 默认仓库的分支
在趋势投资项目的访问git是这样配置的
spring:
application:
name: index-config-server
cloud:
config:
label: master
server:
git:
uri: https://github.com/how2j/trendConfig/
searchPaths: respo
eureka:
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/
最后访问的是这个
https://github.com/how2j/trendConfig/blob/master/respo/trend-trading-backtest-view-dev.properties