diff --git a/spring-boot-project/pom.xml b/spring-boot-project/pom.xml
index 6c62aa8799..542650cd94 100644
--- a/spring-boot-project/pom.xml
+++ b/spring-boot-project/pom.xml
@@ -21,8 +21,8 @@
spring-boot-actuator
spring-boot-actuator-autoconfigure
spring-boot-autoconfigure
- spring-boot-deprecated-properties-support
spring-boot-devtools
+ spring-boot-properties-migrator
spring-boot-test
spring-boot-test-autoconfigure
spring-boot-tools
diff --git a/spring-boot-project/spring-boot-dependencies/pom.xml b/spring-boot-project/spring-boot-dependencies/pom.xml
index aec5923100..20677d0211 100644
--- a/spring-boot-project/spring-boot-dependencies/pom.xml
+++ b/spring-boot-project/spring-boot-dependencies/pom.xml
@@ -239,11 +239,6 @@
spring-boot-autoconfigure-processor
${revision}
-
- org.springframework.boot
- spring-boot-configuration-analyzer
- ${revision}
-
org.springframework.boot
spring-boot-configuration-metadata
@@ -269,6 +264,11 @@
spring-boot-loader-tools
${revision}
+
+ org.springframework.boot
+ spring-boot-properties-migrator
+ ${revision}
+
org.springframework.boot
spring-boot-starter
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-deprecated-properties-support/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index ae46395649..0000000000
--- a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,2 +0,0 @@
-org.springframework.context.ApplicationListener=\
-org.springframework.boot.deprecatedproperties.DeprecatedPropertiesListener
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/pom.xml b/spring-boot-project/spring-boot-properties-migrator/pom.xml
similarity index 84%
rename from spring-boot-project/spring-boot-deprecated-properties-support/pom.xml
rename to spring-boot-project/spring-boot-properties-migrator/pom.xml
index 1dae21e147..0398d4dce9 100644
--- a/spring-boot-project/spring-boot-deprecated-properties-support/pom.xml
+++ b/spring-boot-project/spring-boot-properties-migrator/pom.xml
@@ -8,9 +8,9 @@
${revision}
../spring-boot-parent
- spring-boot-deprecated-properties-support
- Spring Boot Deprecated Properties Support
- Spring Boot Deprecated Properties Support
+ spring-boot-properties-migrator
+ Spring Boot Properties Migrator
+ Spring Boot Properties Migrator
${basedir}/../..
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesListener.java b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesListener.java
similarity index 88%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesListener.java
rename to spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesListener.java
index d7949c3773..c93ff6dd90 100644
--- a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesListener.java
+++ b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesListener.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.boot.deprecatedproperties;
+package org.springframework.boot.legacyproperties;
import java.io.IOException;
import java.io.InputStream;
@@ -35,19 +35,19 @@ import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
/**
* An {@link ApplicationListener} that inspects the {@link ConfigurableEnvironment
- * environment} for deprecated configuration keys. Automatically renames the keys that
+ * environment} for legacy configuration keys. Automatically renames the keys that
* have a matching replacement and log a report of what was discovered.
*
* @author Stephane Nicoll
* @since 2.0.0
*/
-public class DeprecatedPropertiesListener
+public class LegacyPropertiesListener
implements ApplicationListener {
private static final Log logger = LogFactory
- .getLog(DeprecatedPropertiesListener.class);
+ .getLog(LegacyPropertiesListener.class);
- private DeprecatedPropertiesReport report;
+ private LegacyPropertiesReport report;
private boolean reported;
@@ -58,13 +58,13 @@ public class DeprecatedPropertiesListener
}
if (event instanceof ApplicationReadyEvent
|| event instanceof ApplicationFailedEvent) {
- logLegacyPropertiesAnalysis();
+ logLegacyPropertiesReport();
}
}
private void onApplicationPreparedEvent(ApplicationPreparedEvent event) {
ConfigurationMetadataRepository repository = loadRepository();
- DeprecatedPropertiesReporter reporter = new DeprecatedPropertiesReporter(repository,
+ LegacyPropertiesReporter reporter = new LegacyPropertiesReporter(repository,
event.getApplicationContext().getEnvironment());
this.report = reporter.getReport();
}
@@ -90,7 +90,7 @@ public class DeprecatedPropertiesListener
return builder.build();
}
- private void logLegacyPropertiesAnalysis() {
+ private void logLegacyPropertiesReport() {
if (this.report == null || this.reported) {
return;
}
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReport.java b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesReport.java
similarity index 77%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReport.java
rename to spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesReport.java
index 591bfdda04..c16d1ff799 100644
--- a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReport.java
+++ b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesReport.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.boot.deprecatedproperties;
+package org.springframework.boot.legacyproperties;
import java.util.ArrayList;
import java.util.Collections;
@@ -28,13 +28,13 @@ import org.springframework.boot.configurationmetadata.ConfigurationMetadataPrope
import org.springframework.util.StringUtils;
/**
- * Provides a deprecated properties report.
+ * Provides a legacy properties report.
*
* @author Stephane Nicoll
*/
-class DeprecatedPropertiesReport {
+class LegacyPropertiesReport {
- private final Map content = new LinkedHashMap<>();
+ private final Map content = new LinkedHashMap<>();
/**
* Return a report for all the legacy properties that were automatically renamed. If
@@ -42,8 +42,8 @@ class DeprecatedPropertiesReport {
* @return a report with the configurations keys that should be renamed
*/
public String getWarningReport() {
- Map> content = getContent(
- DeprecatedProperties::getRenamed);
+ Map> content = getContent(
+ LegacyProperties::getRenamed);
if (content.isEmpty()) {
return null;
}
@@ -66,8 +66,8 @@ class DeprecatedPropertiesReport {
* @return a report with the configurations keys that are no longer supported
*/
public String getErrorReport() {
- Map> content = getContent(
- DeprecatedProperties::getUnsupported);
+ Map> content = getContent(
+ LegacyProperties::getUnsupported);
if (content.isEmpty()) {
return null;
}
@@ -85,8 +85,8 @@ class DeprecatedPropertiesReport {
return report.toString();
}
- private Map> getContent(
- Function> extractor) {
+ private Map> getContent(
+ Function> extractor) {
return this.content.entrySet().stream()
.filter((entry) -> !extractor.apply(entry.getValue()).isEmpty())
.collect(Collectors.toMap(Map.Entry::getKey,
@@ -94,11 +94,11 @@ class DeprecatedPropertiesReport {
}
private void append(StringBuilder report,
- Map> content,
+ Map> content,
Function deprecationMessage) {
content.forEach((name, properties) -> {
report.append(String.format("Property source '%s':%n", name));
- properties.sort(DeprecatedProperty.COMPARATOR);
+ properties.sort(LegacyProperty.COMPARATOR);
properties.forEach((property) -> {
ConfigurationMetadataProperty metadata = property.getMetadata();
report.append(String.format("\tKey: %s%n", metadata.getId()));
@@ -119,32 +119,32 @@ class DeprecatedPropertiesReport {
* @param renamed the properties that were renamed
* @param unsupported the properties that are no longer supported
*/
- void add(String name, List renamed,
- List unsupported) {
- this.content.put(name, new DeprecatedProperties(renamed, unsupported));
+ void add(String name, List renamed,
+ List unsupported) {
+ this.content.put(name, new LegacyProperties(renamed, unsupported));
}
- private static class DeprecatedProperties {
+ private static class LegacyProperties {
- private final List renamed;
+ private final List renamed;
- private final List unsupported;
+ private final List unsupported;
- DeprecatedProperties(List renamed,
- List unsupported) {
+ LegacyProperties(List renamed,
+ List unsupported) {
this.renamed = asNewList(renamed);
this.unsupported = asNewList(unsupported);
}
private List asNewList(List source) {
- return (source == null ? Collections.emptyList() : new ArrayList(source));
+ return (source == null ? Collections.emptyList() : new ArrayList<>(source));
}
- public List getRenamed() {
+ public List getRenamed() {
return this.renamed;
}
- public List getUnsupported() {
+ public List getUnsupported() {
return this.unsupported;
}
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReporter.java b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesReporter.java
similarity index 83%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReporter.java
rename to spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesReporter.java
index ef83a0599c..b51ef148bc 100644
--- a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReporter.java
+++ b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyPropertiesReporter.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.boot.deprecatedproperties;
+package org.springframework.boot.legacyproperties;
import java.util.ArrayList;
import java.util.Collections;
@@ -40,17 +40,17 @@ import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
/**
- * Report on {@link DeprecatedProperty deprecated properties}.
+ * Report on {@link LegacyProperty legacy properties}.
*
* @author Stephane Nicoll
*/
-class DeprecatedPropertiesReporter {
+class LegacyPropertiesReporter {
private final Map allProperties;
private final ConfigurableEnvironment environment;
- DeprecatedPropertiesReporter(ConfigurationMetadataRepository metadataRepository,
+ LegacyPropertiesReporter(ConfigurationMetadataRepository metadataRepository,
ConfigurableEnvironment environment) {
this.allProperties = Collections
.unmodifiableMap(metadataRepository.getAllProperties());
@@ -62,9 +62,9 @@ class DeprecatedPropertiesReporter {
* legacy properties if a replacement exists.
* @return the analysis
*/
- public DeprecatedPropertiesReport getReport() {
- DeprecatedPropertiesReport report = new DeprecatedPropertiesReport();
- Map> properties = getMatchingProperties(
+ public LegacyPropertiesReport getReport() {
+ LegacyPropertiesReport report = new LegacyPropertiesReport();
+ Map> properties = getMatchingProperties(
deprecatedFilter());
if (properties.isEmpty()) {
return report;
@@ -80,20 +80,19 @@ class DeprecatedPropertiesReporter {
}
private PropertySource> mapPropertiesWithReplacement(
- DeprecatedPropertiesReport report, String name,
- List properties) {
- List renamed = new ArrayList<>();
- List unsupported = new ArrayList<>();
- properties.forEach((property) -> {
- (isRenamed(property) ? renamed : unsupported).add(property);
- });
+ LegacyPropertiesReport report, String name,
+ List properties) {
+ List renamed = new ArrayList<>();
+ List unsupported = new ArrayList<>();
+ properties.forEach((property) ->
+ (isRenamed(property) ? renamed : unsupported).add(property));
report.add(name, renamed, unsupported);
if (renamed.isEmpty()) {
return null;
}
String target = "migrate-" + name;
Map content = new LinkedHashMap<>();
- for (DeprecatedProperty candidate : renamed) {
+ for (LegacyProperty candidate : renamed) {
OriginTrackedValue value = OriginTrackedValue.of(
candidate.getProperty().getValue(),
candidate.getProperty().getOrigin());
@@ -102,7 +101,7 @@ class DeprecatedPropertiesReporter {
return new OriginTrackedMapPropertySource(target, content);
}
- private boolean isRenamed(DeprecatedProperty property) {
+ private boolean isRenamed(LegacyProperty property) {
ConfigurationMetadataProperty metadata = property.getMetadata();
String replacementId = metadata.getDeprecation().getReplacement();
if (StringUtils.hasText(replacementId)) {
@@ -128,9 +127,9 @@ class DeprecatedPropertiesReporter {
return null;
}
- private Map> getMatchingProperties(
+ private Map> getMatchingProperties(
Predicate filter) {
- MultiValueMap result = new LinkedMultiValueMap<>();
+ MultiValueMap result = new LinkedMultiValueMap<>();
List candidates = this.allProperties.values()
.stream().filter(filter).collect(Collectors.toList());
getPropertySourcesAsMap().forEach((name, source) -> {
@@ -140,7 +139,7 @@ class DeprecatedPropertiesReporter {
ConfigurationPropertyName.of(metadata.getId()));
if (configurationProperty != null) {
result.add(name,
- new DeprecatedProperty(metadata, configurationProperty));
+ new LegacyProperty(metadata, configurationProperty));
}
});
});
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedProperty.java b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyProperty.java
similarity index 89%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedProperty.java
rename to spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyProperty.java
index eb832f7ef2..6a806be413 100644
--- a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/DeprecatedProperty.java
+++ b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/LegacyProperty.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.boot.deprecatedproperties;
+package org.springframework.boot.legacyproperties;
import java.util.Comparator;
@@ -28,9 +28,9 @@ import org.springframework.boot.origin.TextResourceOrigin;
*
* @author Stephane Nicoll
*/
-class DeprecatedProperty {
+class LegacyProperty {
- public static final Comparator COMPARATOR = Comparator
+ public static final Comparator COMPARATOR = Comparator
.comparing((property) -> property.getMetadata().getId());
private final ConfigurationMetadataProperty metadata;
@@ -39,7 +39,7 @@ class DeprecatedProperty {
private final Integer lineNumber;
- DeprecatedProperty(ConfigurationMetadataProperty metadata,
+ LegacyProperty(ConfigurationMetadataProperty metadata,
ConfigurationProperty property) {
this.metadata = metadata;
this.property = property;
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/package-info.java b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/package-info.java
similarity index 84%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/package-info.java
rename to spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/package-info.java
index cc01f68604..96e7a6bc22 100644
--- a/spring-boot-project/spring-boot-deprecated-properties-support/src/main/java/org/springframework/boot/deprecatedproperties/package-info.java
+++ b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/legacyproperties/package-info.java
@@ -15,6 +15,6 @@
*/
/**
- * Support for migrating deprecated Spring Boot properties.
+ * Support for migrating legacy Spring Boot properties.
*/
-package org.springframework.boot.deprecatedproperties;
+package org.springframework.boot.legacyproperties;
diff --git a/spring-boot-project/spring-boot-properties-migrator/src/main/resources/META-INF/spring.factories b/spring-boot-project/spring-boot-properties-migrator/src/main/resources/META-INF/spring.factories
new file mode 100644
index 0000000000..3023d42112
--- /dev/null
+++ b/spring-boot-project/spring-boot-properties-migrator/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,2 @@
+org.springframework.context.ApplicationListener=\
+org.springframework.boot.legacyproperties.LegacyPropertiesListener
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/test/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesListenerTests.java b/spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/legacyproperties/LegacyPropertiesListenerTests.java
similarity index 91%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/test/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesListenerTests.java
rename to spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/legacyproperties/LegacyPropertiesListenerTests.java
index 946a2bdafd..76e6692be5 100644
--- a/spring-boot-project/spring-boot-deprecated-properties-support/src/test/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesListenerTests.java
+++ b/spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/legacyproperties/LegacyPropertiesListenerTests.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.boot.deprecatedproperties;
+package org.springframework.boot.legacyproperties;
import org.junit.After;
import org.junit.Rule;
@@ -28,11 +28,11 @@ import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
/**
- * Tests for {@link DeprecatedPropertiesListener}.
+ * Tests for {@link LegacyPropertiesListener}.
*
* @author Stephane Nicoll
*/
-public class DeprecatedPropertiesListenerTests {
+public class LegacyPropertiesListenerTests {
@Rule
public final OutputCapture output = new OutputCapture();
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/test/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReporterTests.java b/spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/legacyproperties/LegacyPropertiesReporterTests.java
similarity index 95%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/test/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReporterTests.java
rename to spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/legacyproperties/LegacyPropertiesReporterTests.java
index fdc6f2a637..f576975991 100644
--- a/spring-boot-project/spring-boot-deprecated-properties-support/src/test/java/org/springframework/boot/deprecatedproperties/DeprecatedPropertiesReporterTests.java
+++ b/spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/legacyproperties/LegacyPropertiesReporterTests.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.boot.deprecatedproperties;
+package org.springframework.boot.legacyproperties;
import java.io.IOException;
import java.util.ArrayList;
@@ -39,11 +39,11 @@ import org.springframework.mock.env.MockEnvironment;
import static org.assertj.core.api.Assertions.assertThat;
/**
- * Tests for {@link DeprecatedPropertiesReporter}.
+ * Tests for {@link LegacyPropertiesReporter}.
*
* @author Stephane Nicoll
*/
-public class DeprecatedPropertiesReporterTests {
+public class LegacyPropertiesReporterTests {
private ConfigurableEnvironment environment = new MockEnvironment();
@@ -172,9 +172,9 @@ public class DeprecatedPropertiesReporterTests {
return createAnalyzer(repository).getReport().getErrorReport();
}
- private DeprecatedPropertiesReporter createAnalyzer(
+ private LegacyPropertiesReporter createAnalyzer(
ConfigurationMetadataRepository repository) {
- return new DeprecatedPropertiesReporter(repository, this.environment);
+ return new LegacyPropertiesReporter(repository, this.environment);
}
}
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/test/resources/config/config-error-no-replacement.properties b/spring-boot-project/spring-boot-properties-migrator/src/test/resources/config/config-error-no-replacement.properties
similarity index 100%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/test/resources/config/config-error-no-replacement.properties
rename to spring-boot-project/spring-boot-properties-migrator/src/test/resources/config/config-error-no-replacement.properties
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/test/resources/config/config-error.properties b/spring-boot-project/spring-boot-properties-migrator/src/test/resources/config/config-error.properties
similarity index 100%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/test/resources/config/config-error.properties
rename to spring-boot-project/spring-boot-properties-migrator/src/test/resources/config/config-error.properties
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/test/resources/config/config-warnings.properties b/spring-boot-project/spring-boot-properties-migrator/src/test/resources/config/config-warnings.properties
similarity index 100%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/test/resources/config/config-warnings.properties
rename to spring-boot-project/spring-boot-properties-migrator/src/test/resources/config/config-warnings.properties
diff --git a/spring-boot-project/spring-boot-deprecated-properties-support/src/test/resources/metadata/sample-metadata.json b/spring-boot-project/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json
similarity index 100%
rename from spring-boot-project/spring-boot-deprecated-properties-support/src/test/resources/metadata/sample-metadata.json
rename to spring-boot-project/spring-boot-properties-migrator/src/test/resources/metadata/sample-metadata.json