How to run bootRun with spring profile via gradle task

前端 未结 13 1418
误落风尘
误落风尘 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 19:56

    I wanted it simple just to be able to call gradle bootRunDev like you without having to do any extra typing..

    This worked for me - by first configuring it the bootRun in my task and then right after it running bootRun which worked fine for me :)

    task bootRunDev {
        bootRun.configure {
            systemProperty "spring.profiles.active", 'Dev'
        }
    }
    
    bootRunDev.finalizedBy bootRun
    

提交回复
热议问题