From 3fbf5eeb5bf442318972b1b3085638f7666195ec Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 26 May 2021 09:20:58 +0200 Subject: [PATCH 1/2] Document spring.profiles.default in the reference guide Closes gh-26592 --- .../src/docs/asciidoc/howto.adoc | 16 ++++++++++++++++ .../src/docs/asciidoc/spring-boot-features.adoc | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc index 05067bc0dc..515bc6328c 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto.adoc @@ -349,6 +349,22 @@ See "`<>`" in the "`Spring Boo +[[howto-set-default-spring-profile-name]] +=== Set the Default Profile Name +The default profile is a profile that is enabled if no profile is active. +By default, the name of the default profile is `default`, but it could be changed using a System property (configprop:spring.profiles.default[]) or an OS environment variable (configprop:spring.profiles.default[format=envvar]). + +In Spring Boot, you can also set the default profile name in `application.properties`, as shown in the following example: + +[source,properties,indent=0,subs="verbatim,quotes,attributes",configprops] +---- + spring.profiles.default=dev +---- + +See "`<>`" in the "`Spring Boot features`" section for more information. + + + [[howto-change-configuration-depending-on-the-environment]] === Change Configuration Depending on the Environment A YAML file is actually a sequence of documents separated by `---` lines, and each document is parsed separately to a flattened map. diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index 642773ffaa..eac7fc45a4 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -1667,6 +1667,14 @@ For example, you could include it in your `application.properties`, as shown in You could also specify it on the command line by using the following switch: `--spring.profiles.active=dev,hsqldb`. +If no profile is active, a default profile is enabled. +The name of the default profile is `default` and it can be tuned using the configprop:spring.profiles.default[] `Environment` property, as shown in the following example: + +[source,properties,indent=0,configprops] +---- + spring.profiles.default=none +---- + [[boot-features-adding-active-profiles]] From 67fe60ba8a77cca0a82df4e81c0e650db0a68697 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 28 May 2021 13:26:37 +0200 Subject: [PATCH 2/2] Add missing static on JerseyInfrastructureConfiguration Closes gh-26695 --- .../web/jersey/JerseySameManagementContextConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/jersey/JerseySameManagementContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/jersey/JerseySameManagementContextConfiguration.java index 9de0cc4019..4971e4303b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/jersey/JerseySameManagementContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/jersey/JerseySameManagementContextConfiguration.java @@ -57,7 +57,7 @@ public class JerseySameManagementContextConfiguration { @Configuration(proxyBeanMethods = false) @Import(JerseyManagementContextConfiguration.class) @ConditionalOnMissingBean(ResourceConfig.class) - class JerseyInfrastructureConfiguration { + static class JerseyInfrastructureConfiguration { @Bean @ConditionalOnMissingBean(JerseyApplicationPath.class)