Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -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]
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,13 +60,10 @@
|
||||
<!-- This can be removed in the next major -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>${okhttp.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>logging-interceptor</artifactId>
|
||||
<artifactId>okhttp-bom</artifactId>
|
||||
<version>${okhttp.version}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user