2019.01.23 期待已久的Spring Cloud Greenwich 發佈了release版本,做爲咱們團隊也第一時間把RC版本替換爲release,如下爲總結,但願對你使用Spring Cloud Greenwich 有所幫助 Greenwich 只支持 Spring Boot 2.1.x 分支。若是使用 2.0.x 請使用Finchley版本,git
主要是適配JAVA11github
<!--支持Spring Boot 2.1.X--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>2.1.2.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> <!--Greenwich.RELEASE--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Greenwich.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency>
除了Git、File、JDBC,新版本提供 在Cloud Foundry的CredHub存儲功能spring
spring: profiles: active: credhub cloud: config: server: credhub: url: https://credhub:8844
這裏提供了一個例子: Spring Cloud Gateway and Spring Security OAuth2bootstrap
整合的時候有個坑能夠參考這個issue:ReactiveManagementWebSecurityAutoConfiguration Prevent's oauth2Login from being defaultedide
spring: cloud: gateway: routes: - id: rewriteresponseheader_route uri: http://example.org filters: - RewriteResponseHeader=X-Response-Foo, , password=[^&]+, password=***
對Spring Cloud Finchley 進行直接升級時候發現feign啓動報錯了spring-boot
*************************** APPLICATION FAILED TO START *************************** Description: The bean 'pigx-upms-biz.FeignClientSpecification', defined in null, could not be registered. A bean with that name has already been defined in null and overriding is disabled. Action: Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true Process finished with exit code 1
bootstrap.yml
中配置spring.main.allow-bean-definition-overriding=true
這是Spring Boot 2.1 後新增的屬性運行bean 覆蓋,不要配置到配置中內心面,否則無效url
This will be used as the bean name instead of name if present, but will not be used as a service id.
就能夠用這個屬性區分@FeigenClient 標誌的同一個service 的接口日誌