<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
And add @EnableConfigServer
on application
To use the native file configuration instead of git, set the application.properties
with
server.port=8888
spring.profiles.active=native
spring.cloud.config.server.native.searchLocations=classpath:/XXX
debug=true
info.id=${spring.application.name}
Client spring boot application should remove the application.properties
and create a bootstrap.properties
spring.application.name=my-name
spring.cloud.config.uri=http://localhost:8888
And add @EnableDiscoveryClient
on application
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
And add @EnableEurekaServer
on application
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zuul</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
And add @EnableZuulProxy
on application