SpringBoot - 15项目打包与多环境配置
(1)项目打包
(1.1)打包插件
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build>
(1.2)打包
(1.3)运行
(2)多环境配置
语法结构: application-{profile}.properties/yml
profile: 代表某个配置环境的标识
- application-dev.properties/yml 开发环境
- application-test.properties/yml 测试环境
- application-prod.properties/yml 生产环境
启动方式:
- java -jar xxx.jar --spring.profiles.active={profile}