05_springboot多配置文件

1.多配置文件,其中application.properties中的spring.profiles.active能够灵活的切换使用环境

application.properties

spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
spring.profiles.active=pro

application-dev.properties

server.port=8080
server.context-path=/test

application-pro.properties

server.port=80
server.context-path=/

2.部署,在项目目录下生成jar包mvn install

在pro环境下运行

image-20201110084937318

在dev环境下运行

image-20201110085024608
posted @ 2020-11-23 17:32  脑袋有点大  阅读(176)  评论(0编辑  收藏  举报