How to pass system property to Gradle task

前端 未结 14 2590
别跟我提以往
别跟我提以往 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 02:56

    According to the spring-boot-gradle-plugin documentation you should be able to pass arguments like this

    ./gradlew bootRun --args='--spring.profiles.active=dev'
    

    Seems like this is a new gradle feature since 4.9. I used it in my project and it worked out of the box.

提交回复
热议问题