How to set environment vars in IntelliJ for Gradle tasks

前端 未结 3 1626
小蘑菇
小蘑菇 2021-02-05 02:46

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.

3条回答
  •  迷失自我
    2021-02-05 03:18

    Make the System.properties available in the bootRun (or other) tasks.

    bootRun.systemProperties = System.properties
    

    This way we can set in IntelliJ VM Options like -Dspring.profiles.active=dev.

提交回复
热议问题