current position:Home>Spring boot quickly switches the configuration of development environment and production environment (application. YML)

Spring boot quickly switches the configuration of development environment and production environment (application. YML)

2022-05-15 05:15:37A grain of rice

1. To create a 2 individual yml The configuration file , Production environment and development environment

 Insert picture description here

2. Add different configurations to different configuration files

 Insert picture description here

 Insert picture description here

3. In general application.yml Add the configuration

 Insert picture description here
The configuration will be automatically selected when running
 Insert picture description here

copyright notice
author[A grain of rice],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/131/202205111246440134.html

Random recommended