Spring Boot prioritizes command-line arguments, environment variables, and application.properties.
Spring Boot follows a specific order to resolve configuration properties, ensuring flexibility. Command-line arguments take the highest priority, followed by environment variables, and then application.properties or application.yml files. This allows for dynamic adjustments without code changes. For instance, if you have a property 'server.port' set in application.properties but also pass it as a command-line argument, the command-line argument will take precedence.
Additional Notes
How does Spring Boot prioritize configuration sources?