diff --git a/README.adoc b/README.adoc index 4a826d42..9a61475e 100644 --- a/README.adoc +++ b/README.adoc @@ -293,7 +293,7 @@ Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, th [[duplicate-finder-configuration]] === Duplicate Finder configuration -Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`. +Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the project's `pom.xml`. .pom.xml [source,xml] diff --git a/docs/package.json b/docs/package.json index 6c97a4cc..1e4c440b 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,6 +5,6 @@ "@antora/collector-extension": "1.0.1", "@asciidoctor/tabs": "1.0.0-beta.6", "@springio/antora-extensions": "1.14.4", - "@springio/asciidoctor-extensions": "1.0.0-alpha.16" + "@springio/asciidoctor-extensions": "1.0.0-alpha.17" } } diff --git a/spring-cloud-commons-dependencies/pom.xml b/spring-cloud-commons-dependencies/pom.xml index ffb6747f..d0b105b9 100644 --- a/spring-cloud-commons-dependencies/pom.xml +++ b/spring-cloud-commons-dependencies/pom.xml @@ -60,13 +60,10 @@ com.squareup.okhttp3 - okhttp - ${okhttp.version} - - - com.squareup.okhttp3 - logging-interceptor + okhttp-bom ${okhttp.version} + import + pom diff --git a/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java b/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java index a9ac9132..94b4b466 100644 --- a/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java +++ b/spring-cloud-context/src/test/java/org/springframework/cloud/bootstrap/config/BootstrapConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,6 +49,7 @@ import static org.assertj.core.api.BDDAssertions.then; /** * @author Dave Syer + * @author Yanming Zhou * */ public class BootstrapConfigurationTests { @@ -740,6 +741,23 @@ public class BootstrapConfigurationTests { .anyMatch("local"::equals)).isTrue(); } + @Test // GH-1416 + public void bootstrapPropertiesWithActivateOnProfile() { + String bootstrapLocation = "spring.cloud.bootstrap.location=classpath:external-properties/bootstrap.yaml"; + String legacyProcessing = "spring.config.use-legacy-processing=true"; + this.context = new SpringApplicationBuilder().web(WebApplicationType.NONE) + .sources(BareConfiguration.class) + .properties(bootstrapLocation, legacyProcessing) + .run(); + then(this.context.getEnvironment().getProperty("info.name")).isEqualTo("externalPropertiesInfoName"); + + this.context = new SpringApplicationBuilder().web(WebApplicationType.NONE) + .sources(BareConfiguration.class) + .properties(bootstrapLocation, legacyProcessing, "spring.profiles.active=bar") + .run(); + then(this.context.getEnvironment().getProperty("info.name")).isEqualTo("externalPropertiesInfoName from bar"); + } + @Configuration(proxyBeanMethods = false) @EnableConfigurationProperties protected static class BareConfiguration { diff --git a/spring-cloud-context/src/test/resources/external-properties/bootstrap.yaml b/spring-cloud-context/src/test/resources/external-properties/bootstrap.yaml new file mode 100644 index 00000000..d7a12bd4 --- /dev/null +++ b/spring-cloud-context/src/test/resources/external-properties/bootstrap.yaml @@ -0,0 +1,7 @@ +spring.main.sources: org.springframework.cloud.bootstrap.config.BootstrapConfigurationTests.PropertySourceConfiguration +info.name: externalPropertiesInfoName + +--- +spring.config.activate.on-profile: bar +info.name: externalPropertiesInfoName from bar +