diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java b/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java index 9f793ec..d6bc961 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/config/AdditionalPropertiesConfig.java @@ -12,6 +12,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.MutablePropertySources; import org.springframework.core.env.PropertiesPropertySource; +import org.springframework.core.env.PropertySource; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.core.io.support.PropertiesLoaderUtils; @@ -42,6 +43,14 @@ public class AdditionalPropertiesConfig implements EnvironmentPostProcessor { return resources; } + private void showSpringConfiguration(MutablePropertySources properties) { + + System.out.print("** Used Spring property sources **\n\n"); + for (PropertySource source : properties) { + System.out.println(source.toString()); + } + } + @Override public void postProcessEnvironment( ConfigurableEnvironment environment, @@ -63,6 +72,7 @@ public class AdditionalPropertiesConfig implements EnvironmentPostProcessor { } } + showSpringConfiguration(propertySources); } }