From 3abd8d3adfe9ed0b8b24f24c12f428e00fb39617 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 4 May 2017 17:01:07 +0100 Subject: [PATCH] Drop support for configuring PropertiesLauncher with application.properties Closes gh-8464 --- .../appendix-executable-jar-format.adoc | 6 ----- .../boot/loader/PropertiesLauncher.java | 26 +++++-------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc b/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc index 7d8ac458eb1..a864ddb096c 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-executable-jar-format.adoc @@ -201,12 +201,6 @@ the appropriate launcher: properties (System properties, environment variables, manifest entries or `loader.properties`). -NOTE: `PropertiesLauncher` supports loading properties from -`loader.properties` and also (for historic reasons) -`application.properties`. We recommend using -`loader.properties` exclusively, as support for -`application.properties` is deprecated and may be removed in the future. - |=== |Key |Purpose diff --git a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java index ee828072a07..3aaefebe242 100755 --- a/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java +++ b/spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/PropertiesLauncher.java @@ -46,10 +46,10 @@ import org.springframework.boot.loader.util.SystemPropertyUtils; * well-behaved OS-level services than a model based on executable jars. *

* Looks in various places for a properties file to extract loader settings, defaulting to - * {@code application.properties} either on the current classpath or in the current - * working directory. The name of the properties file can be changed by setting a System - * property {@code loader.config.name} (e.g. {@code -Dloader.config.name=foo} will look - * for {@code foo.properties}. If that file doesn't exist then tries + * {@code loader.properties} either on the current classpath or in the current working + * directory. The name of the properties file can be changed by setting a System property + * {@code loader.config.name} (e.g. {@code -Dloader.config.name=foo} will look for + * {@code foo.properties}. If that file doesn't exist then tries * {@code loader.config.location} (with allowed prefixes {@code classpath:} and * {@code file:} or any valid URL). Once that file is located turns it into Properties and * extracts optional values (which can also be provided overridden as System properties in @@ -156,8 +156,7 @@ public class PropertiesLauncher extends Launcher { configs.add(getProperty(CONFIG_LOCATION)); } else { - String[] names = getPropertyWithDefault(CONFIG_NAME, "loader,application") - .split(","); + String[] names = getPropertyWithDefault(CONFIG_NAME, "loader").split(","); for (String name : names) { configs.add("file:" + getHomeDirectory() + "/" + name + ".properties"); configs.add("classpath:" + name + ".properties"); @@ -175,10 +174,6 @@ public class PropertiesLauncher extends Launcher { resource.close(); } for (Object key : Collections.list(this.properties.propertyNames())) { - if (config.endsWith("application.properties") - && ((String) key).startsWith("loader.")) { - warn("Use of application.properties for PropertiesLauncher is deprecated"); - } String text = this.properties.getProperty((String) key); String value = SystemPropertyUtils .resolvePlaceholders(this.properties, text); @@ -608,19 +603,10 @@ public class PropertiesLauncher extends Launcher { private void debug(String message) { if (Boolean.getBoolean(DEBUG)) { - log(message); + System.out.println(message); } } - private void warn(String message) { - log("WARNING: " + message); - } - - private void log(String message) { - // We shouldn't use java.util.logging because of classpath issues - System.out.println(message); - } - /** * Convenience class for finding nested archives that have a prefix in their file path * (e.g. "lib/").