Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
f64d5303
Commit
f64d5303
authored
Oct 18, 2016
by
Phillip Johnson
Committed by
Andy Wilkinson
Nov 25, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document and test array support for spring.profiles.*
Closes gh-7175 Closes gh-6995
parent
919d0c61
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
3 deletions
+19
-3
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+2
-2
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+3
-1
ConfigFileApplicationListenerTests.java
...ot/context/config/ConfigFileApplicationListenerTests.java
+8
-0
testsetmultiprofileslist.yml
spring-boot/src/test/resources/testsetmultiprofileslist.yml
+6
-0
No files found.
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
f64d5303
...
...
@@ -128,8 +128,8 @@ content into your application; rather pick only the properties that you need.
spring.pid.file= # Location of the PID file to write (if ApplicationPidFileWriter is used).
# PROFILES
spring.profiles.active= # Comma-separated list of <<howto-set-active-spring-profiles,active profiles>>.
spring.profiles.include= # Unconditionally activate the specified comma separated profiles.
spring.profiles.active= # Comma-separated list
(or list if using YAML)
of <<howto-set-active-spring-profiles,active profiles>>.
spring.profiles.include= # Unconditionally activate the specified comma separated profiles
(or list of profiles if using YAML)
.
# SENDGRID ({sc-spring-boot-autoconfigure}/sendgrid/SendGridAutoConfiguration.{sc-ext}[SendGridAutoConfiguration])
spring.sendgrid.api-key= # SendGrid api key (alternative to username/password)
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
f64d5303
...
...
@@ -1173,7 +1173,9 @@ For example, when an application with following properties is run using the swit
my.property: fromyamlfile
---
spring.profiles: prod
spring.profiles.include: proddb,prodmq
spring.profiles.include:
- proddb
- prodmq
----
NOTE: Remember that the `spring.profiles` property can be defined in a YAML document
...
...
spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java
View file @
f64d5303
...
...
@@ -536,6 +536,14 @@ public class ConfigFileApplicationListenerTests {
"healthcheck"
);
}
@Test
public
void
yamlSetsMultiProfilesWhenListProvided
()
throws
Exception
{
this
.
initializer
.
setSearchNames
(
"testsetmultiprofileslist"
);
this
.
initializer
.
postProcessEnvironment
(
this
.
environment
,
this
.
application
);
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"dev"
,
"healthcheck"
);
}
@Test
public
void
yamlSetsMultiProfilesWithWhitespace
()
throws
Exception
{
this
.
initializer
.
setSearchNames
(
"testsetmultiprofileswhitespace"
);
...
...
spring-boot/src/test/resources/testsetmultiprofileslist.yml
0 → 100644
View file @
f64d5303
---
spring
:
profiles
:
active
:
-
dev
-
healthcheck
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment