Spring Boot — Override config property value before the application startup
In this article we are going to create a spring boot application in which we will set the database password by reading them from the windows credential manager. Lets create a new spring boot project from https://start.spring.io/ with dependencies Spring web, Spring data jpa, Lombok and MySql driver. Your project structure should look like this Open this project in Intellij idea. Database Lets create a mysql database or you can use any existing database. I have created a database by name testdb and we will try to make connection to this database through our spring boot app. Windows Credential Manager Lets add an entry in the windows credential manager for our database username and password. Click on add a generic credential. Password I used here is root. Click OK to save the credential. Windows Credential Manager Java API We will be using this Java api to retrieve the username and password from windows credential manager. GitHub - dariusz-szczepaniak/java.jna.WindowsCredentialManager: