Restore active profile logic and support +

Restore the previous `spring.profiles.active` logic effectively
reverting commit 37069d9. This ensures that active profiles defined in
a higher `PropertySource` replace those lower down.

In addition, add support for a `+` prefix that can be used to indicate
that a profile should be added to the active set.

For example:

	# application-prod.properties
	spring.profiles.active=+proddb,+prodmq

Fixed gh-308, gh-309
This commit is contained in:
Phillip Webb
2014-02-04 14:06:02 -08:00
parent 31c385470e
commit 6ddbf3bd92
8 changed files with 58 additions and 17 deletions

View File

@@ -894,7 +894,7 @@ In Spring Boot you can also set the active profile in
`application.properties`, e.g.
```properties
spring.profiles.active: production
spring.profiles.active=production
```
A value set this way is replaced by the System property or environment
@@ -902,6 +902,7 @@ variable setting, but not by the `SpringApplicationBuilder.profiles()`
method. Thus the latter Java API can be used to augment the profiles
without changing the defaults.
## Change the Location of External Properties of an Application
By default properties from different sources are added to the Spring