Home > Back-end >  Spring the boot using an error No active profile set, falling back to the default profiles: default
Spring the boot using an error No active profile set, falling back to the default profiles: default

Time:09-16

Follow station B tutorial to try to do a web crawler
But Springboot suggest there is a problem, all the results are as follows:
Saw some blogs to add
But there is no role
Think, every brother please bother to give directions, thank you,

CodePudding user response:

First for this tip is not an error, just suggest you use the default configuration, if need to distinguish between environment (such as database links), can be in the application. The properties and application. In the yml set up multiple profile, and then specify spring. Profiles. The active
For example:
Server:
Port: 8080
Spring:
Profiles:
Active: the prod
-- -- --
Server:
Port: 8081
Spring:
Profiles: dev
-- -- --
Server:
Port: 8082
Spring:
Profiles: prod # specify which belongs to the environment

CodePudding user response:

First of all, this is not an error, is not even a warning, you can see the log level for the INFO, just a hint of ascension you haven't configure the environment, then use the default default environment, this is normal!

But if you have multiple environments, such as PROD production environment, the development environment DEV, you can construct three files,
+ application. Yml
+ application - dev. Yml
+ application - prod. Yml

At the same time in the application. The yml by spring. Profiles: indicate the application - dev. Dev yml effect or spring. Profiles: indicate the application - prod. Prod yml effect, so as not to use the default environment
  • Related