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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3f077-447f9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3f077-447f9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?