How to switch profile? of springboot Project in idea

when using Idea before, because it is a non-springboot project, create three new
dev,test,prod environments under the src/main/resources directory, and then switch to the environment under profiles under Maven projects on the right side of the IDEA.

now three springboot, environments are used for different configurations: application-dev/test/pro.properties, needs to switch manually in application.properties .

spring.profiles.active

can you also switch with the next button under profiles under Maven projects on the right side of IDEA?


  1. if your environment is completely separate, for example, dev is dev , pro is pro , you can directly specify profile :

    clipboard.png

  2. common+dev dev common+pro proactive:

    clipboard.png

Menu