此问题与此post有关。这种方法似乎今天早些时候工作,但现在我看到下面的响应,而不是看到属性定义了属性文件 -
{
"name": "order-service"
"profiles": [1]
0: "dev-v1"
-
"label": null
"version": "0299eae906ee10555b68bd1bfe36bd390728969e"
"propertySources": [0]
}
我看到空的propertySources。
以下是我的application.yml
中定义的内容spring:
cloud:
config:
server:
git:
uri: https://github.companyname.com/projectname/orderservice-properties
username: ordersvc
password: ordersvc
search-paths: order-service,v*
github网址有2个文件夹v1和v2,文件order-service-dev.properties。
请你告诉我我错过了什么?感谢。
修改
我将application.yml更改为以下内容:
spring:
cloud:
config:
server:
git:
uri: https://github.companyname.com/projectname/orderservice-properties
username: ordersvc
password: ordersvc
search-paths: order-service/v*
现在,当使用端点http://localhost:8080/order-service/dev时,我会看到以下内容。如何查看特定端点的数据(例如v1或v2)?
{
"name": "order-service"
"profiles": [1]
0: "dev"
-
"label": null
"version": "693378d4145cca50e38d5b9e39afbe1a3b334c6c"
"propertySources": [2]
0: {
"name": "https://github.companyname.com/projectname/orderservice-properties/order-service/v2/order-service-dev.properties"
"source": {
"key3": "value3"
"key2": "value2"
"key1": "value1"
}-
}-
1: {
"name": "https://github.companyname.com/projectname/orderservice-properties/order-service/v1/order-service-dev.properties"
"source": {
"key3": "value3"
"key2": "value2"
"key1": "value1"
}
}
}