How to run bootRun with spring profile via gradle task

前端 未结 13 1380
误落风尘
误落风尘 2020-12-04 19:20

I\'m trying to set up gradle to launch the bootRun process with various spring profiles enabled.

My current bootRun configuration looks lik

13条回答
  •  时光取名叫无心
    2020-12-04 20:11

    Spring Boot v2 Gradle plugin docs provide an answer:

    6.1. Passing arguments to your application

    Like all JavaExec tasks, arguments can be passed into bootRun from the command line using --args='' when using Gradle 4.9 or later.

    To run server with active profile set to dev:

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

提交回复
热议问题