This is an old revision of the document!
Central configuration client
- pom.xml
<dependencies> <!-- config --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-parent</artifactId> <version>Angel.SR4</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
// ADD Refresh scope @RefreshScope public class LoginController { // Add varibole @Value("${testaaa}") private String testaaa; }
- bootstrap.properties
spring.application.name=service-auth spring.cloud.config.uri=http://localhost:8080/eco-central-config