Spring Boot: passing system properties to maven

前端 未结 3 2090
误落风尘
误落风尘 2021-02-15 16:41

I tried:

mvn -Dspring.profiles.active=dev spring-boot:run

but it does not affect my default configuration. I\'ve googled a little and found:

3条回答
  •  执笔经年
    2021-02-15 17:29

    With the current version (>= 2.0.0.RELEASE), the parameter is -Dspring-boot.run.jvmArguments

    Source: Sprint-boot plugin

    mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dspring.profiles.active=dev"

    It's also possible to do:

    mvn spring-boot:run -Dspring-boot.run.profiles=dev

提交回复
热议问题