how to use Spring Boot profiles

前端 未结 12 1175
忘了有多久
忘了有多久 2020-12-04 21:14

i have application.yml,application-dev.ymlandapplication-dev.yml

  1. I\'m using the maven command mvn spring-boot:run
12条回答
  •  时光取名叫无心
    2020-12-04 22:05

    Use "-Dspring-boot.run.profiles=foo,local" in Intellij IDEA. It's working. Its sets 2 profiles "foo and local".

    Verified with boot version "2.3.2.RELEASE" & Intellij IDEA CE 2019.3.

    
            
                
                    org.springframework.boot
                    spring-boot-maven-plugin
                
            
        
    
    

    Setting profile with "mvn spring-boot:run"

    Setting environment variable

提交回复
热议问题