Spring Cloud Config客戶端使用
阿新 • • 發佈:2018-01-25
release 標準 client 簡單 app eas 一個 方便 rop 要在應用程序中使用這些功能,只需將其構建為依賴於spring-cloud-config-client的Spring引導應用程序(例如,查看配置客戶端或示例應用程序的測試用例)。添加依賴關系的最方便的方法是通過Spring Boot啟動器org.springframework.cloud:spring-cloud-starter-config。還有一個Maven用戶的父pom和BOM(spring-cloud-starter-parent)和用於Gradle和Spring CLI用戶的Spring IO版本管理屬性文件。示例Maven配置:
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent> <artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement> <artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
的pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<version>1.3.5.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<version>Brixton.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Spring Cloud Config客戶端使用