HTTPサービスは、フォーム内のリソースを持っているドキュメントと
、Iの初めに春の雲の設定を誤って理解するようだ:
「アプリケーションは」として注入され
/{application}/{profile}[/{label}]
/{application}-{profile}.yml
/{label}/{application}-{profile}.yml
/{application}-{profile}.properties
/{label}/{application}-{profile}.properties
> SpringApplicationのspring.config.name(通常のSpring Boot>アプリケーションでは通常は "アプリケーション")、 "profile"はアクティブなプロファイル(またはコンマで区切られたプロパティのリスト)、> "label"はオプションのgitラベル(デフォルトは "master")
春の雲の設定組み込みのメカニズムでは0
、春の雲の設定は、RESTリソースとしてすべてのプロパティを公開しますので、ここで
- アプリケーションは春ブートクライアントプロジェクト
spring.application.name
です
- プロファイルは春のブートクライアントプロジェクトで
spring.profiles.active
- ラベルはGitのGitのレポがspecifでGitのブランチ名です春のクラウド設定サーバーによるic。
spring.cloud.config.server.git.uri
クライアントは、上記のルールに対するすべてのプロパティをGET
できます。
は通常、春のブートクライアントのプロジェクトのために、同じように春の雲の設定サーバーを設定へ必要があります。
spring:
application:
name: eureka
cloud:
config:
uri: http://localhost:8888
profiles:
active: dev, prod
だから、クライアント意志GET
すべてのプロパティ:春の雲の設定サーバでeureka-dev.yml
とeureka-prod.yml
。
環境固有のプロパティー(つまり、 'application.properties'と' application- [profile] .properties')を読み込むのと同じルールが、設定サーバーからロードされたプロパティーに適用されます。 'bootstrap.properties'と' bootstrap- [profile] .properties'にも適用されます... –
@ M.Deinumはい、別のenvに対しては、application- [profile] .propertiesのアプローチを使用することができます。 –