I have a multi-module maven based project which has a number of Spring Boot applications, a couple of which (lets call them A
and B
) connect to a database (I have a separate module with the database related code on which both applications depend.) I am also using Flyway to maintain the database versioning and maintain the database structure.
What is the best approach to maintain the database properties? At the moment I have 3 places where I am repeating the same thing. I have the application.yml
of module A
and application.yml
of module B
, since both are separate Spring Boot applications. Then I have the Flyway plugin configuration again which needs the properties in the pom.xml
to be able to perform its tasks, like clean
, repair
and migrate
.
What is the proper approach to centralise and externalise this information, like the database URL, username and password? I am also facing the issue that each time I pull the new code onto the test system I have to update the same data again because it gets overwritten, and the database configuration on the test system is different from my local development environment.
What is the best strategy to manage this?