The Flowers Are Still Standing
In a previous blog post, I discussed how to load an application's Spring Framework configuration in a Groovy script. This is a great way to test portions of your application without running the entire application. However, this approach has limits. When trying this with a Spring Boot application, you miss out on a bunch of the magical auto-enabling done by Spring Boot. This includes the ability of Spring Boot to find certain properties and configuration files and load their contents for use by Spring Framework's property placeholder mechanism. In this post, I'll discuss how to include a little extra Groovy sauce to get the Spring Framework context to load a YAML file from the classpath and use its values for property placeholder replacement. Let's start by looking at how to tell the Spring Framework context how to load the YAML file:
Read full article from The Flowers Are Still Standing
No comments:
Post a Comment