Profile-Specific Properties

Studio can read application properties from profile-specific files, if spring.profiles.active property is set in the main application.properties file. It allows you to have a separate profile for development environment.

The example below shows how to create a dev profile defining properties for the database connection and use it as the default for your development environment.

application.properties
spring.profiles.active = dev

# ...
application-dev.properties
main.datasource.url = jdbc:postgresql://localhost/onboarding
main.datasource.username = root
main.datasource.password = root

After making these changes, the Data Store Properties editor in Studio will read and write properties to and from the application-dev.properties file instead of application.properties.

You can exclude the application-dev.properties file from your version control system (VCS) to prevent sharing connection settings. When running the application in production, a different profile can be specified using a command-line argument or an environment variable.