spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

NativeEnvironmentRepository in Greenwich.RELEASE version spring-cloud-config-server File System Backend not work 'native.search-locations: file:///D:/code'??

Open haycco opened this issue 7 years ago • 7 comments

HI, I am using Spring Cloud Greenwich.RELEASE version with spring-cloud-config-server '2.1.0.RELEASE', when I configuration spring.cloud.config.server.native.search-locations: file:///D:/code/abvc/config-server/target/config-repo but cannot read file.

config-repo

|-dev |--|- application.properties |--|- abvc-user-service.properties |-test |--|- application.properties |--|- abvc-user-service.properties ...

I found the under class

package org.springframework.cloud.config.server.environment;

public class NativeEnvironmentRepository
		implements EnvironmentRepository, SearchPathLocator, Ordered {
}

vs old version is miss @ConfigurationProperties("spring.cloud.config.server.native") because it is already set

package org.springframework.cloud.config.server.environment

@ConfigurationProperties("spring.cloud.config.server.native")
public class NativeEnvironmentProperties implements EnvironmentRepositoryProperties{ ... }

Actually no effect。

when I visit

http://127.0.0.1:8888/dev/abvc-user-service.properties

is empty

when I set spring.cloud.config.server.native.search-locations: classpath:config-repo/ is work fine! and now it is a bug?

haycco avatar Feb 19 '19 03:02 haycco

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

ryanjbaxter avatar Feb 19 '19 14:02 ryanjbaxter

@ryanjbaxter OK, I have create the Minimal project for the same problem Spring Cloud Config Server Demo please.

haycco avatar Feb 20 '19 02:02 haycco

I have no problem when using your sample and pointing towards my own native config repo. Here is what I got when I hit /application/default/master

{  
   "name":"application",
   "profiles":[  
      "default"
   ],
   "label":"master",
   "version":null,
   "state":null,
   "propertySources":[  
      {  
         "name":"file:///Users/ryanjbaxter/git-repos/ryanjbaxter/spring-cloud-samples/config-repo/application.yml (document #0)",
         "source":{  
            "info.description":"Spring Cloud Samples",
            "info.url":"https://github.com/spring-cloud-samples",
            "eureka.client.serviceUrl.defaultZone":"http://localhost:8761/eureka/"
         }
      }
   ]
}

ryanjbaxter avatar Feb 26 '19 21:02 ryanjbaxter

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Mar 05 '19 21:03 spring-projects-issues

I have make another person run the demo, have the same error. Quite strange~~

haycco avatar Mar 07 '19 03:03 haycco

Without a way to reproduce it locally there is not much we can do to help

ryanjbaxter avatar Mar 07 '19 21:03 ryanjbaxter

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Mar 14 '19 21:03 spring-projects-issues