SpringBoot 不同的环境,打不同的包名
同一台服务器上装了开发、测试环境。如果放在不同的目录下,文件名相同,在使用Java Sprintboot jar 项目启动、停止脚本 脚本时,会对启动、停止操作有影响
默认为:${artifactId}-${version}
pom.xml
<!--与build标签同级别,放在project标签中-->
<profiles>
<profile>
<id>dev</id>
<properties>
<activeProfile>dev</activeProfile>
</properties>
<build>
<finalName>${artifactId}-${activeProfile}-${version}</finalName>
</build>
<!-- 默认环境 -->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>pre</id>
<properties>
<activeProfile>pre</activeProfile>
</properties>
<build>
<finalName>${artifactId}-${activeProfile}-${version}</finalName>
</build>
</profile>
<profile>
<id>pro</id>
<properties>
<activeProfile>pro</activeProfile>
</properties>
<build>
<finalName>${artifactId}-${activeProfile}-${version}</finalName>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
spring:
profiles:
active: @activeProfile@
本文来自博客园,作者:VipSoft 转载请注明原文链接:https://www.cnblogs.com/vipsoft/p/18577679
分类:
JAVA
标签:
SpringBoot
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 本地部署 DeepSeek:小白也能轻松搞定!
· 基于DeepSeek R1 满血版大模型的个人知识库,回答都源自对你专属文件的深度学习。
· 如何给本地部署的DeepSeek投喂数据,让他更懂你
· 在缓慢中沉淀,在挑战中重生!2024个人总结!
· 大人,时代变了! 赶快把自有业务的本地AI“模型”训练起来!
2023-11-29 Excel 条件格式
2022-11-29 Kubernetes(K8S) Service 介绍