profile是Spring对不同环境提供不同配置功能的支持,可以通过激活、指定参数的方式来快速切换环境。
第一种方式
yml多文档块方式
第二种方式
第三中方式
先将项目打包,然后运行命令。
java -jar spring-boot-hello-quick-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod
第四种方式
profile是Spring对不同环境提供不同配置功能的支持,可以通过激活、指定参数的方式来快速切换环境。
第一种方式
yml多文档块方式
第二种方式
第三中方式
先将项目打包,然后运行命令。
java -jar spring-boot-hello-quick-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod
第四种方式