【发布时间】:2019-06-30 14:34:31
【问题描述】:
我正在尝试使用后端存储库(文件系统)设置 Spring Cloud Config Server,但端点(http://localhost:8888/licensingservice/default)返回以下内容:
{"name":"licensingservice","profiles":["default"],"label":null,"version":null,"state":null,"propertySources":[]}
主要:
@EnableConfigServer
@SpringBootApplication
public class ConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServerApplication.class, args);
}
}
application.yml:
server:
port: 8888
spring:
profiles:
active: native
cloud:
config:
server:
native:
searchLocations: file:///Users/josedavi/Desenvolvimento/WorkSpace/Pessoal/sample-spring-microservices/sample-spring-microservices/config-server/src/main/resources/config
许可服务.yml:
tracer.property: "I AM THE DEFAULT"
spring.jpa.database: "POSTGRESQL"
spring.datasource.platform: "postgres"
spring.jpa.show-sql: "true"
spring.database.driverClassName: "org.postgresql.Driver"
spring.datasource.url: "jdbc:postgresql://database:5432/eagle_eye_local"
spring.datasource.username: "postgres"
spring.datasource.password: "p0stgr@s"
spring.datasource.testWhileIdle: "true"
spring.datasource.validationQuery: "SELECT 1"
spring.jpa.properties.hibernate.dialect: "org.hibernate.dialect.PostgreSQLDialect"
服务配置路径:
C:\Users\josedavi\Desenvolvimento\WorkSpace\Pessoal\sample-spring-microservices\sample-spring-microservices\config-server\src\main\resources\config
项目: https://github.com/jdavid-araujo/sample-spring-microservices
【问题讨论】:
-
我有一个工作正常的样本。你能提供一个重现问题的项目吗?你用的是什么版本?
-
我正在使用 Spring Boot:2.1.2 和 Spring Cloud:Greenwich。项目在 gitHub:github.com/jdavid-araujo/sample-spring-microservices.
标签: spring spring-boot spring-cloud spring-cloud-config