| Start |
|---|
| Dev and Prod environment using different datasources After succesfully setup Spring-Boot application all the configuration is handled in an application.properties file. You will find the file at Normally there is a need to have a database behind the application. For development its good to have a setup of A good example is to configure two databases. One for For the For the In your default or Important is that the part after Now you are able to start Spring-Boot application in develop or production mode by just changing the identifier. An in-Memory database will startup or the connection to a "real" database. Sure there are also much more use cases to have multiple property files. |
| Set the right spring-profile by building the application automatically (maven) By creating multiple properties files for the different environments or use cases, its sometimes hard to manually change the Let's say there are three environments property files in our application:
Those three files just differ in port and active profile name. In the main
After that we just have to add the maven profiles in our You are now able to build the application with maven. If you dont set any maven profile, its building the default one (in this example it's dev). For specify one you have to use a maven keyword. The keyword to set a profile in maven is Now, you are also able to create custom builds and save those in your Examples:
|
Read Article
https://develop.horje.com/learn/1434/reference