Write configuration parameters (such as port numbers, database addresses) for different environments (test, production) in their own files.

1. Create configuration files for each environment

Application -{profile}. Properties Profile can be dev,prod,preCopy the code

2. After the environment configuration is created, add the following code to the application.properties project

# default test environment dev spring.profiles. Active =devCopy the code

3, deployment,

As configured above, the default Jar package is for the test environment. If you need to switch, append –spring.profiles. Active to the start command