the easiest way to pass spring profiles to gradle bootRun is (for me) by environment variable (e.g. SPRING_PROFILES_ACTIVE), when run on commandline.>
gradle bootRun
SPRING_PROFILES_ACTIVE
Make the System.properties available in the bootRun (or other) tasks.
System.properties
bootRun
bootRun.systemProperties = System.properties
This way we can set in IntelliJ VM Options like -Dspring.profiles.active=dev.
-Dspring.profiles.active=dev