From a16e4474079f976de4e5c6e0549f8622c5030bcb Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 21 Sep 2021 14:27:28 +0000 Subject: [PATCH 1/4] Update SNAPSHOT to 3.0.5 --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client-tls-tests/pom.xml | 2 +- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 4 ++-- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index d3589bd6..a7626a3c 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.5 .. diff --git a/pom.xml b/pom.xml index 8a87cd8e..bdd9b6a2 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.5 pom Spring Cloud Config Spring Cloud Config @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-build - 3.0.4-SNAPSHOT + 3.0.4 @@ -27,7 +27,7 @@ config - 3.0.4-SNAPSHOT + 3.0.4 1.11.903 v1-rev20201112-1.30.10 true diff --git a/spring-cloud-config-client-tls-tests/pom.xml b/spring-cloud-config-client-tls-tests/pom.xml index 2f25abcf..71148040 100644 --- a/spring-cloud-config-client-tls-tests/pom.xml +++ b/spring-cloud-config-client-tls-tests/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.5 .. diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 7a854b5f..a8cd11b1 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.5 .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 3a88be79..bddf6e59 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -6,11 +6,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 3.0.4-SNAPSHOT + 3.0.4 spring-cloud-config-dependencies - 3.0.5-SNAPSHOT + 3.0.5 pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index e265fca9..cdc0758d 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.5 .. spring-cloud-config-monitor @@ -14,7 +14,7 @@ Spring Cloud Config Monitor ${basedir}/../.. - 3.0.4-SNAPSHOT + 3.0.3 diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 47baa566..38e95077 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.5 .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index c427ef18..9d01ebe3 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.5 .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index 45843bc2..86a1ec62 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.5 spring-cloud-starter-config - 3.0.5-SNAPSHOT + 3.0.5 spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From e6aa33a1daadbe464428e781e125954d1d994ed5 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 21 Sep 2021 14:30:23 +0000 Subject: [PATCH 2/4] Going back to snapshots --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client-tls-tests/pom.xml | 2 +- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 4 ++-- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index a7626a3c..d3589bd6 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5 + 3.0.5-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index bdd9b6a2..8a87cd8e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 3.0.5 + 3.0.5-SNAPSHOT pom Spring Cloud Config Spring Cloud Config @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-build - 3.0.4 + 3.0.4-SNAPSHOT @@ -27,7 +27,7 @@ config - 3.0.4 + 3.0.4-SNAPSHOT 1.11.903 v1-rev20201112-1.30.10 true diff --git a/spring-cloud-config-client-tls-tests/pom.xml b/spring-cloud-config-client-tls-tests/pom.xml index 71148040..2f25abcf 100644 --- a/spring-cloud-config-client-tls-tests/pom.xml +++ b/spring-cloud-config-client-tls-tests/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index a8cd11b1..7a854b5f 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index bddf6e59..3a88be79 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -6,11 +6,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 3.0.4 + 3.0.4-SNAPSHOT spring-cloud-config-dependencies - 3.0.5 + 3.0.5-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index cdc0758d..e265fca9 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5 + 3.0.5-SNAPSHOT .. spring-cloud-config-monitor @@ -14,7 +14,7 @@ Spring Cloud Config Monitor ${basedir}/../.. - 3.0.3 + 3.0.4-SNAPSHOT diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 38e95077..47baa566 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index 9d01ebe3..c427ef18 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index 86a1ec62..45843bc2 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 3.0.5 + 3.0.5-SNAPSHOT spring-cloud-starter-config - 3.0.5 + 3.0.5-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From dea6e10c61cdce678101095ca5f77a1e3402e852 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 21 Sep 2021 14:30:23 +0000 Subject: [PATCH 3/4] Bumping versions to 3.0.6-SNAPSHOT after release --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-config-client-tls-tests/pom.xml | 2 +- spring-cloud-config-client/pom.xml | 2 +- spring-cloud-config-dependencies/pom.xml | 4 ++-- spring-cloud-config-monitor/pom.xml | 4 ++-- spring-cloud-config-sample/pom.xml | 2 +- spring-cloud-config-server/pom.xml | 2 +- spring-cloud-starter-config/pom.xml | 4 ++-- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index d3589bd6..7bd55b5c 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -8,7 +8,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 8a87cd8e..bacd9189 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT pom Spring Cloud Config Spring Cloud Config @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-build - 3.0.4-SNAPSHOT + 3.0.4 @@ -27,7 +27,7 @@ config - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT 1.11.903 v1-rev20201112-1.30.10 true diff --git a/spring-cloud-config-client-tls-tests/pom.xml b/spring-cloud-config-client-tls-tests/pom.xml index 2f25abcf..00f03fb9 100644 --- a/spring-cloud-config-client-tls-tests/pom.xml +++ b/spring-cloud-config-client-tls-tests/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT .. diff --git a/spring-cloud-config-client/pom.xml b/spring-cloud-config-client/pom.xml index 7a854b5f..383bf84a 100644 --- a/spring-cloud-config-client/pom.xml +++ b/spring-cloud-config-client/pom.xml @@ -10,7 +10,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT .. diff --git a/spring-cloud-config-dependencies/pom.xml b/spring-cloud-config-dependencies/pom.xml index 3a88be79..cb10eb7a 100644 --- a/spring-cloud-config-dependencies/pom.xml +++ b/spring-cloud-config-dependencies/pom.xml @@ -6,11 +6,11 @@ spring-cloud-dependencies-parent org.springframework.cloud - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT spring-cloud-config-dependencies - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT pom spring-cloud-config-dependencies Spring Cloud Config Dependencies diff --git a/spring-cloud-config-monitor/pom.xml b/spring-cloud-config-monitor/pom.xml index e265fca9..bdfb37e5 100644 --- a/spring-cloud-config-monitor/pom.xml +++ b/spring-cloud-config-monitor/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT .. spring-cloud-config-monitor @@ -14,7 +14,7 @@ Spring Cloud Config Monitor ${basedir}/../.. - 3.0.4-SNAPSHOT + 3.0.3 diff --git a/spring-cloud-config-sample/pom.xml b/spring-cloud-config-sample/pom.xml index 47baa566..870d7b5f 100644 --- a/spring-cloud-config-sample/pom.xml +++ b/spring-cloud-config-sample/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT .. diff --git a/spring-cloud-config-server/pom.xml b/spring-cloud-config-server/pom.xml index c427ef18..d2597543 100644 --- a/spring-cloud-config-server/pom.xml +++ b/spring-cloud-config-server/pom.xml @@ -13,7 +13,7 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT .. diff --git a/spring-cloud-starter-config/pom.xml b/spring-cloud-starter-config/pom.xml index 45843bc2..b26ac15a 100644 --- a/spring-cloud-starter-config/pom.xml +++ b/spring-cloud-starter-config/pom.xml @@ -6,10 +6,10 @@ org.springframework.cloud spring-cloud-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT spring-cloud-starter-config - 3.0.5-SNAPSHOT + 3.0.6-SNAPSHOT spring-cloud-starter-config Spring Cloud Starter https://projects.spring.io/spring-cloud From 41e50e345d07276402402b8e95e7a222b3dc0c02 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Tue, 19 Oct 2021 12:18:19 -0400 Subject: [PATCH 4/4] Move ConfigServerBootstrapApplicationListener to EnvironmentPostProcessor (#1984) * Move ConfigServerBootstrapApplicationListener to EnvironmentPostProcessor Fixes #1983 * Reverted classname and interface changes to avoid breaking anyone --- ...figServerBootstrapApplicationListener.java | 27 +++++++++++++------ .../main/resources/META-INF/spring.factories | 6 +++-- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/bootstrap/ConfigServerBootstrapApplicationListener.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/bootstrap/ConfigServerBootstrapApplicationListener.java index 06e9ad5b..e0d0c4ef 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/bootstrap/ConfigServerBootstrapApplicationListener.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/bootstrap/ConfigServerBootstrapApplicationListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2021 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. @@ -18,8 +18,10 @@ package org.springframework.cloud.config.server.bootstrap; import java.util.Collections; +import org.springframework.boot.SpringApplication; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; +import org.springframework.boot.env.EnvironmentPostProcessor; import org.springframework.context.ApplicationListener; import org.springframework.core.Ordered; import org.springframework.core.env.ConfigurableEnvironment; @@ -43,10 +45,15 @@ import org.springframework.core.env.PropertySource; * This listener is only to prevent it from using HTTP to contact itself. * * @author Dave Syer + * @author Ryan Baxter * */ +// TODO We changed this class from an ApplicationListener to an EnvironmentPostProcessor +// but did not change the class name to avoid breaking anyone in a minor release. +// In the next major it will be safe to change the class name and remove the +// ApplicationListener interface. public class ConfigServerBootstrapApplicationListener - implements ApplicationListener, Ordered { + implements ApplicationListener, EnvironmentPostProcessor, Ordered { /** * Default order of the bootstrap application listener. @@ -58,6 +65,15 @@ public class ConfigServerBootstrapApplicationListener private PropertySource propertySource = new MapPropertySource("configServerClient", Collections.singletonMap("spring.cloud.config.enabled", "false")); + @Override + public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { + if (!environment.resolvePlaceholders("${spring.cloud.config.enabled:false}").equalsIgnoreCase("true")) { + if (!environment.getPropertySources().contains(this.propertySource.getName())) { + environment.getPropertySources().addLast(this.propertySource); + } + } + } + @Override public int getOrder() { return this.order; @@ -69,12 +85,7 @@ public class ConfigServerBootstrapApplicationListener @Override public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { - ConfigurableEnvironment environment = event.getEnvironment(); - if (!environment.resolvePlaceholders("${spring.cloud.config.enabled:false}").equalsIgnoreCase("true")) { - if (!environment.getPropertySources().contains(this.propertySource.getName())) { - environment.getPropertySources().addLast(this.propertySource); - } - } + postProcessEnvironment(event.getEnvironment(), event.getSpringApplication()); } } diff --git a/spring-cloud-config-server/src/main/resources/META-INF/spring.factories b/spring-cloud-config-server/src/main/resources/META-INF/spring.factories index 906a6cf4..31eb4d95 100644 --- a/spring-cloud-config-server/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-config-server/src/main/resources/META-INF/spring.factories @@ -2,9 +2,11 @@ org.springframework.cloud.bootstrap.BootstrapConfiguration=\ org.springframework.cloud.config.server.bootstrap.ConfigServerBootstrapConfiguration,\ org.springframework.cloud.config.server.config.EncryptionAutoConfiguration -# Application listeners -org.springframework.context.ApplicationListener=\ + +# Environment PostProcessor +org.springframework.boot.env.EnvironmentPostProcessor=\ org.springframework.cloud.config.server.bootstrap.ConfigServerBootstrapApplicationListener + # Autoconfiguration org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ org.springframework.cloud.config.server.config.ConfigServerAutoConfiguration,\