Sync docs from 2.1.x to gh-pages
This commit is contained in:
@@ -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 <code class="literal">SpringApplicationBuilder</code> lets you share an <code class="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><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="customizing-bootstrap-properties" href="#customizing-bootstrap-properties"></a>1.3 Changing the Location of Bootstrap Properties</h2></div></div></div><p>The <code class="literal">bootstrap.yml</code> (or <code class="literal">.properties</code>) location can be specified by setting <code class="literal">spring.cloud.bootstrap.name</code> (default: <code class="literal">bootstrap</code>) or <code class="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><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="customizing-bootstrap-properties" href="#customizing-bootstrap-properties"></a>1.3 Changing the Location of Bootstrap Properties</h2></div></div></div><p>The <code class="literal">bootstrap.yml</code> (or <code class="literal">.properties</code>) location can be specified by setting <code class="literal">spring.cloud.bootstrap.name</code> (default: <code class="literal">bootstrap</code>), <code class="literal">spring.cloud.bootstrap.location</code> (default: empty) or <code class="literal">spring.cloud.bootstrap.additional-location</code> (default: empty) — for example, in System properties.
|
||||
Those properties behave like the <code class="literal">spring.config.*</code> variants with the same name.
|
||||
With <code class="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, <code class="literal">spring.cloud.bootstrap.additional-location</code> could be used.
|
||||
In fact, they are used to set up the bootstrap <code class="literal">ApplicationContext</code> by setting those properties in its <code class="literal">Environment</code>.
|
||||
If there is an active profile (from <code class="literal">spring.profiles.active</code> or through the <code class="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 <code class="literal">bootstrap-development.properties</code> for a <code class="literal">development</code> profile.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="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 <span class="quote">“<span class="quote">remote</span>”</span> (from example, from Spring Cloud Config Server).
|
||||
|
||||
Reference in New Issue
Block a user