Multi-spring boot environment (dev, test, prod) profile --- command-line switch

  • properties configuration format
In Spring boot environment in a multi-profile name required to meet application- {profile} .properties format, which {profile} environment for your identity, such as:

 

Configuring spring.profiles.active in application.properties the default development environment = dev #

 

When starting jar package, using a command line switch

  • java -jar xxx.jar --spring.profiles.active = test // test environment configuration file 
    java -jar xxx.jar --spring.profiles.active = prod // production environment configuration file

     

Guess you like

Origin www.cnblogs.com/shar-wang/p/11618658.html