@ -32,8 +32,10 @@ If there is a Config Server, every context in the hierarchy can also (in princip
@@ -32,8 +32,10 @@ If there is a Config Server, every context in the hierarchy can also (in princip
Normal Spring application context behavior rules apply to property resolution: properties from a child context override those in
the parent, by name and also by property source name.
(If the child has a property source with the same name as the parent, the value from the parent is not included in the child).</p><p>Note that the <codeclass="literal">SpringApplicationBuilder</code> lets you share an <codeclass="literal">Environment</code> amongst the whole hierarchy, but that is not the default.
Thus, sibling contexts, in particular, do not need to have the same profiles or property sources, even though they may share common values with their parent.</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="customizing-bootstrap-properties"href="#customizing-bootstrap-properties"></a>1.3 Changing the Location of Bootstrap Properties</h2></div></div></div><p>The <codeclass="literal">bootstrap.yml</code> (or <codeclass="literal">.properties</code>) location can be specified by setting <codeclass="literal">spring.cloud.bootstrap.name</code> (default: <codeclass="literal">bootstrap</code>) or <codeclass="literal">spring.cloud.bootstrap.location</code> (default: empty) — for example, in System properties.
Thus, sibling contexts, in particular, do not need to have the same profiles or property sources, even though they may share common values with their parent.</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="customizing-bootstrap-properties"href="#customizing-bootstrap-properties"></a>1.3 Changing the Location of Bootstrap Properties</h2></div></div></div><p>The <codeclass="literal">bootstrap.yml</code> (or <codeclass="literal">.properties</code>) location can be specified by setting <codeclass="literal">spring.cloud.bootstrap.name</code> (default: <codeclass="literal">bootstrap</code>), <codeclass="literal">spring.cloud.bootstrap.location</code> (default: empty) or <codeclass="literal">spring.cloud.bootstrap.additional-location</code> (default: empty) — for example, in System properties.
Those properties behave like the <codeclass="literal">spring.config.*</code> variants with the same name.
With <codeclass="literal">spring.cloud.bootstrap.location</code> the default locations are replaced and only the specified ones are used.
To add locations to the list of default ones, <codeclass="literal">spring.cloud.bootstrap.additional-location</code> could be used.
In fact, they are used to set up the bootstrap <codeclass="literal">ApplicationContext</code> by setting those properties in its <codeclass="literal">Environment</code>.
If there is an active profile (from <codeclass="literal">spring.profiles.active</code> or through the <codeclass="literal">Environment</code> API in the
context you are building), properties in that profile get loaded as well, the same as in a regular Spring Boot app — for example, from <codeclass="literal">bootstrap-development.properties</code> for a <codeclass="literal">development</code> profile.</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="overriding-bootstrap-properties"href="#overriding-bootstrap-properties"></a>1.4 Overriding the Values of Remote Properties</h2></div></div></div><p>The property sources that are added to your application by the bootstrap context are often <spanclass="quote">“<spanclass="quote">remote</span>”</span> (from example, from Spring Cloud Config Server).
@ -38,8 +38,10 @@ If there is a Config Server, every context in the hierarchy can also (in princip
@@ -38,8 +38,10 @@ If there is a Config Server, every context in the hierarchy can also (in princip
Normal Spring application context behavior rules apply to property resolution: properties from a child context override those in
the parent, by name and also by property source name.
(If the child has a property source with the same name as the parent, the value from the parent is not included in the child).</p><p>Note that the <codeclass="literal">SpringApplicationBuilder</code> lets you share an <codeclass="literal">Environment</code> amongst the whole hierarchy, but that is not the default.
Thus, sibling contexts, in particular, do not need to have the same profiles or property sources, even though they may share common values with their parent.</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="customizing-bootstrap-properties"href="#customizing-bootstrap-properties"></a>1.3 Changing the Location of Bootstrap Properties</h2></div></div></div><p>The <codeclass="literal">bootstrap.yml</code> (or <codeclass="literal">.properties</code>) location can be specified by setting <codeclass="literal">spring.cloud.bootstrap.name</code> (default: <codeclass="literal">bootstrap</code>) or <codeclass="literal">spring.cloud.bootstrap.location</code> (default: empty) — for example, in System properties.
Thus, sibling contexts, in particular, do not need to have the same profiles or property sources, even though they may share common values with their parent.</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="customizing-bootstrap-properties"href="#customizing-bootstrap-properties"></a>1.3 Changing the Location of Bootstrap Properties</h2></div></div></div><p>The <codeclass="literal">bootstrap.yml</code> (or <codeclass="literal">.properties</code>) location can be specified by setting <codeclass="literal">spring.cloud.bootstrap.name</code> (default: <codeclass="literal">bootstrap</code>), <codeclass="literal">spring.cloud.bootstrap.location</code> (default: empty) or <codeclass="literal">spring.cloud.bootstrap.additional-location</code> (default: empty) — for example, in System properties.
Those properties behave like the <codeclass="literal">spring.config.*</code> variants with the same name.
With <codeclass="literal">spring.cloud.bootstrap.location</code> the default locations are replaced and only the specified ones are used.
To add locations to the list of default ones, <codeclass="literal">spring.cloud.bootstrap.additional-location</code> could be used.
In fact, they are used to set up the bootstrap <codeclass="literal">ApplicationContext</code> by setting those properties in its <codeclass="literal">Environment</code>.
If there is an active profile (from <codeclass="literal">spring.profiles.active</code> or through the <codeclass="literal">Environment</code> API in the
context you are building), properties in that profile get loaded as well, the same as in a regular Spring Boot app — for example, from <codeclass="literal">bootstrap-development.properties</code> for a <codeclass="literal">development</code> profile.</p></div><divclass="section"><divclass="titlepage"><div><div><h2class="title"style="clear: both"><aname="overriding-bootstrap-properties"href="#overriding-bootstrap-properties"></a>1.4 Overriding the Values of Remote Properties</h2></div></div></div><p>The property sources that are added to your application by the bootstrap context are often <spanclass="quote">“<spanclass="quote">remote</span>”</span> (from example, from Spring Cloud Config Server).
@ -97,8 +97,10 @@ Thus, sibling contexts, in particular, do not need to have the same profiles or
@@ -97,8 +97,10 @@ Thus, sibling contexts, in particular, do not need to have the same profiles or
<title>Changing the Location of Bootstrap Properties</title>
<simpara>The <literal>bootstrap.yml</literal> (or <literal>.properties</literal>) location can be specified by setting <literal>spring.cloud.bootstrap.name</literal> (default: <literal>bootstrap</literal>) or <literal>spring.cloud.bootstrap.location</literal> (default: empty) — for example, in System properties.
<simpara>The <literal>bootstrap.yml</literal> (or <literal>.properties</literal>) location can be specified by setting <literal>spring.cloud.bootstrap.name</literal> (default: <literal>bootstrap</literal>), <literal>spring.cloud.bootstrap.location</literal> (default: empty) or <literal>spring.cloud.bootstrap.additional-location</literal> (default: empty) — for example, in System properties.
Those properties behave like the <literal>spring.config.*</literal> variants with the same name.
With <literal>spring.cloud.bootstrap.location</literal> the default locations are replaced and only the specified ones are used.
To add locations to the list of default ones, <literal>spring.cloud.bootstrap.additional-location</literal> could be used.
In fact, they are used to set up the bootstrap <literal>ApplicationContext</literal> by setting those properties in its <literal>Environment</literal>.
If there is an active profile (from <literal>spring.profiles.active</literal> or through the <literal>Environment</literal> API in the
context you are building), properties in that profile get loaded as well, the same as in a regular Spring Boot app — for example, from <literal>bootstrap-development.properties</literal> for a <literal>development</literal> profile.</simpara>