How to pass system property to Gradle task

前端 未结 14 2591
别跟我提以往
别跟我提以往 2020-12-08 02:17

I\'m using Gradle spring-boot plugin and I need to select a spring active profile for the test run.

How do I pass spring.profiles.active sy

14条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-08 03:07

    Just for reference if anyone will have this issue:

    Vlad answer didn't quite worked for me but this one works great with 2.4,

    task local <<{
        bootRun { systemProperty "spring.profiles.active", "local" }
    }
    local.finalizedBy bootRun
    

    then gradle local

提交回复
热议问题