Admin - SpringBoot + Maven 多启动环境配置实例详解
作者:EPIC_MELODY 时间:2022-03-08 09:48:16
一:父级pom.xml文件 resources目录下新建指定文件夹,存放Spring配置文件
<profiles>
<profile>
<id>dev</id>
<properties>
<profiles.active>dev</profiles.active>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>telework</id>
<properties>
<profiles.active>telework</profiles.active>
</properties>
</profile>
<profile>
<id>sit</id>
<properties>
<profiles.active>sit</profiles.active>
</properties>
</profile>
<profile>
<id>pre</id>
<properties>
<profiles.active>pre</profiles.active>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<profiles.active>prod</profiles.active>
</properties>
</profile>
</profiles>
二:application.properties
######################### server ###################
server.servlet.context-path=/i-admin-api
server.port=10086
spring.profiles.active=@profiles.active@
来源:https://blog.csdn.net/qq_42292831/article/details/115269610
标签:SpringBoot,Maven,环境,配置
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Java Maven settings.xml中私有仓库配置详解
2022-02-19 15:36:50
![](https://img.aspxhome.com/file/2023/4/66234_0s.jpg)
Android登录注册功能 数据库SQLite验证
2023-10-01 20:58:55
![](https://img.aspxhome.com/file/2023/6/86926_0s.gif)
java使用dom4j操作xml示例代码
2022-03-21 18:28:38
Java 详解包装类Integer与int有哪些共通和不同
2022-06-15 20:12:18
C#.net实现在Winform中从internet下载文件的方法
2023-09-13 18:04:15
Java常用集合与原理解析
2023-04-01 14:26:42
![](https://img.aspxhome.com/file/2023/3/71603_0s.jpg)
spring-redis-session 自定义 key 和过期时间
2022-03-29 14:34:37
修改Maven settings.xml 后配置未生效的解决
2023-07-06 22:17:03
Java解析Excel内容的方法
2023-03-20 20:36:26
Java技能点之SimpleDateFormat进行日期格式化问题
2023-09-09 01:50:26
![](https://img.aspxhome.com/file/2023/9/58339_0s.jpg)
Fluent Mybatis实际开发中的优势对比
2022-07-09 14:29:34
50 道Java 线程面试题(经典)
2023-11-23 19:47:37
Java日常练习题,每天进步一点点(2)
2023-08-17 22:46:19
![](https://img.aspxhome.com/file/2023/5/63025_0s.png)
Java重点梳理类与对象核心原理
2023-04-08 06:15:41
![](https://img.aspxhome.com/file/2023/7/70297_0s.jpg)
软件开发七大过程模型
2023-12-22 17:06:14
![](https://img.aspxhome.com/file/2023/2/68722_0s.jpg)
java读取文件字符集示例方法
2023-11-09 12:35:39
Java设计模式之命令模式详解
2023-11-15 21:18:43
JAVA面试题 简谈你对synchronized关键字的理解
2022-09-17 17:06:05
IDEA全量替换一次性解决旧项目并将所有文件换行符改为LF问题
2022-09-17 18:44:32
![](https://img.aspxhome.com/file/2023/7/71927_0s.png)
C# 如何设置label(标签)控件的背景颜色为透明
2023-05-27 11:03:00
![](https://img.aspxhome.com/file/2023/2/79042_0s.jpg)