We can only use these expansions within configuration files matching these patterns:

**/application*.yml

**/application*.yaml

**/application*.properties

2.2. Manual Configuration

In the absence of the spring-boot-starter-parent parent, we’ll need to configure this filtering and expansion manually. We’ll need to include resources element into the <build> section of our pom.xml file:

This will resolve all the project’s properties. We still cannot define properties with dots (e.g. user.name) in the build.gradle, but now we can use gradle.properties file to define properties in the standard Java properties format, and it also supports properties with dots (e.g database.url).

This build filters only the project configuration files and not all the resources, and it’s 100% compatible with the Maven solution.

4. Conclusion

In this quick tutorial, we saw how to automatically expand Spring Boot properties using both Maven and Gradle build methods and how we can easily migrate from one to the other.