diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 3c2b314aec..77ec21b2bd 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -475,13 +475,13 @@ defined using the naming convention `application-{profile}.properties`. The used if no active profiles are set (i.e. if no profiles are explicitly activated then properties from `application-default.properties` are loaded). -Profile specific properties are loaded from the same locations as standard +Profile-specific properties are loaded from the same locations as standard `application.properties`, with profile-specific files always overriding the non-specific ones irrespective of whether the profile-specific files are inside or outside your packaged jar. If several profiles are specified, a last wins strategy applies. For example, profiles -specified by the `spring.active.profiles` property are added after those configured via +specified by the `spring.profiles.active` property are added after those configured via the `SpringApplication` API and therefore take precedence. @@ -930,7 +930,7 @@ properties, the highest `PropertySource` will win. This means that you can speci active profiles in `application.properties` then *replace* them using the command line switch. -Sometimes it is useful to have profile specific properties that *add* to the active +Sometimes it is useful to have profile-specific properties that *add* to the active profiles rather than replace them. The `spring.profiles.include` property can be used to unconditionally add active profiles. The `SpringApplication` entry point also has a Java API for setting additional profiles (i.e. on top of those activated by the @@ -963,8 +963,8 @@ possible to activate profiles using Spring's `ConfigurableEnvironment` interface [[boot-features-profile-specific-configuration]] -=== Profile specific configuration files -Profile specific variants of both `application.properties` (or `application.yml`) and +=== Profile-specific configuration files +Profile-specific variants of both `application.properties` (or `application.yml`) and files referenced via `@ConfigurationProperties` are considered as files are loaded. See _<>_ for details. @@ -1045,7 +1045,7 @@ converter will color the output according to the log level, for example: [source,indent=0] ---- -%clr(-%5p}) +%clr(%5p) ---- The mapping of log level to a color is as follows: @@ -1259,7 +1259,7 @@ it's loaded too early. You need to either use `logback-spring.xml` or define a -==== Profile specific configuration +==== Profile-specific configuration The `` tag allows you to optionally include or exclude sections of configuration based on the active Spring profiles. Profile sections are supported anywhere within the `` element. Use the `name` attribute to specify which profile diff --git a/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java b/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java index cf56bb4ce4..762168d1e7 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java @@ -425,7 +425,7 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor, // Search for a file with the given name for (String ext : this.propertiesLoader.getAllFileExtensions()) { if (profile != null) { - // Try the profile specific file + // Try the profile-specific file loadIntoGroup(group, location + name + "-" + profile + "." + ext, null); for (String processedProfile : this.processedProfiles) { @@ -440,7 +440,7 @@ public class ConfigFileApplicationListener implements EnvironmentPostProcessor, loadIntoGroup(group, location + name + "-" + profile + "." + ext, profile); } - // Also try the profile specific section (if any) of the normal file + // Also try the profile-specific section (if any) of the normal file loadIntoGroup(group, location + name + "." + ext, profile); } } diff --git a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java index 97a49e6005..f80bb9a015 100644 --- a/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java +++ b/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigFileApplicationListenerTests.java @@ -194,7 +194,7 @@ public class ConfigFileApplicationListenerTests { assertEquals("myprofile", StringUtils .arrayToCommaDelimitedString(this.environment.getActiveProfiles())); String property = this.environment.getProperty("the.property"); - // The value from the second file wins (no profile specific configuration is + // The value from the second file wins (no profile-specific configuration is // actually loaded) assertThat(property, equalTo("frompropertiesfile")); } @@ -209,7 +209,7 @@ public class ConfigFileApplicationListenerTests { assertEquals("myprofile", StringUtils .arrayToCommaDelimitedString(this.environment.getActiveProfiles())); String property = this.environment.getProperty("the.property"); - // The value from the second file wins (no profile specific configuration is + // The value from the second file wins (no profile-specific configuration is // actually loaded) assertThat(property, equalTo("frompropertiesfile")); }