Complete the code to specify the alternative properties file in Spring Boot.
spring.config.name=[1]Setting spring.config.name to config tells Spring Boot to look for config.yml or config.properties instead of the default application.yml.
Complete the code to load an alternative properties file from a specific location.
spring.config.location=[1]classpath: when the file is outside the classpath.Using spring.config.location with file:./config/ tells Spring Boot to load config files from the local config folder.
Fix the error in the command to run Spring Boot with an alternative config file.
java -jar app.jar --spring.config.name=[1]The spring.config.name property expects the base name without extension. Using config is correct, not config.yml.
Fill both blanks to specify multiple config locations in Spring Boot.
spring.config.location=[1],[2]
You can specify multiple config locations separated by commas. Here, file:./config/ and file:/etc/config/ are two local folders Spring Boot will check.
Fill all three blanks to set an alternative config file name, location, and profile.
java -jar app.jar --spring.config.name=[1] --spring.config.location=[2] --spring.profiles.active=[3]
This command runs the app with a custom config file base name customconfig, loads config files from file:./custom/, and activates the dev profile.