雖然我已經(jīng)成功地使用 GIT 作為后端屬性回購設置了 spring cloud config 客戶端/服務器。但是,對于我的一個客戶端代碼,我有一個遵循模塊結(jié)構(gòu)(maven)的基本問題:客戶 1: common (maven module) app (maven module) web (Contains the spring boot application, bootstrap.properties, application.properties)對于上述結(jié)構(gòu),我能夠從 spring cloud config 服務器讀取/刷新“web”模塊的屬性(因為那是我的 SpringBootApplication 所在的那個),但是無法理解如何在中注入配置/注入屬性其他模塊也一樣,比如公共模塊或應用程序模塊可能有屬性。我嘗試在其他模塊中添加 bootstrap.properties,它們指向同一個 spring 云配置服務器。但這沒有成功。Spring cloud config server application.properties:服務器.port=8888spring.cloud.config.server.git.uri=管理.security.enabled=falseWeb 模塊的 bootstrap.propertiesspring.application.name=測試spring.cloud.config.uri= http://localhost:8888管理.security.enabled=falsespring.profiles.active=默認,產(chǎn)品Maven 依賴項(云配置客戶端): <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> <version>1.4.4.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> <version>1.1.2.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>1.4.4.RELEASE</version> </dependency>請幫助我理解,關(guān)于如何讀取/刷新跨多個模塊(如將部署在單個實例/客戶端上的通用、應用程序或 Web)的屬性。
添加回答
舉報
0/150
提交
取消