Using an External Property File
Learn how to use an external property file in the Java application.
We'll cover the following...
Applications have a lot of configuration and keeping it separate from the code leads to clarity. If the property file is inside the jar when the application is built, it can’t be changed later without having to un-compress the jar. Spring provides a way to change configuration while the application jar remains intact.
The application configuration is different in different environments. Local machines are used in development, then the application moves to a test environment, and afterwards a production server is used. To use different configurations in different environments, a property file is used to externalize the values for each environment. For example, the database connection in the data layer might be different in different environments. The developer can create an application with default properties and deploy it. Then, if the values ...