Spring Cloud Configuration Server not working with local properties file

后端 未结 9 2169
渐次进展
渐次进展 2020-12-05 07:43

I have been playing around with the Spring Cloud project on github located here: https://github.com/spring-cloud/spring-cloud-config

However I have been running into

9条回答
  •  离开以前
    2020-12-05 08:43

    Using spring.profiles.active=native is that what Spring documentation seems to suggest, but I couldn't get it to work either. My application.properties file is

    server.port=8888
    spring.cloud.config.profiles=native 
    

    but the response from the URL

    http://localhost:8888/config-server/env
    

    is

    {"name":"env","label":"master","propertySources":[{"name":"https://github.com/spring-cloud-samples/config-repo/application.yml","source":{"info.url":"https://github.com/spring-cloud-samples","info.description":"Spring Cloud Samples"}}]}
    

    which indicates that native profile was ignored and the server still considering github as property source.

    A small additional problem I encountered is the config service default port. According to the Sprin Cloud Config documentation it should be 8888. If I remove server.port=8888 from my application.properties the config server starts on port 8080 which is default Spring Boot port, but not the one config server should use.

提交回复
热议问题