maven spring profile 协同
请在网上查相关的使用情景,这里直接上要点。另外,可能不只一种方法,但这里只有一种。
1、POM.XML片段,使web.xml文件中有关活跃spring profile的内容可以被maven自动替换
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId><version>2.4</version><configuration><webResources><resource><filtering>true</filtering><directory>src/main/webapp</directory><includes><include>**/web.xml</include></includes></resource></webResources><warSourceDirectory>src/main/webapp</warSourceDirectory><webXml>src/main/webapp/WEB-INF/web.xml</webXml></configuration></plugin>
2、POM.XML片段,在profile中自定义属性。注意id与属性值的一致!
<profile><id>test</id><properties><profile.active>test</profile.active>……</properties></profile><profile><id>dev</id><properties><profile.active>dev</profile.active>……</properties></profile>
3、web.xml片段,使用maven中定义的属性
<context-param><param-name>spring.profiles.active</param-name><param-value>${profile.active}</param-value></context-param>
4、spring配置文件,定义各种Beans的所适用的profile。
<beans profile="test,online"></beans><beans profile="dev"></beans>
maven spring profile 协同相关推荐
- Springboot使用Maven Profile和Spring Profile进行多环境配置
Springboot使用Maven Profile和Spring Profile进行多环境配置 目的 在实际的项目上,一般会分三种环境dev.test.prod来方便我们的开发和部署,要求我们在开发的 ...
- Springboot使用Maven项目使用 Profiles和Spring Profile进行多环境配置 动态激活指定
最终效果:①:IDEA右边"maven"的工具栏 ②:项目配置的多环境选项入口[默认:dev] ③:项目配置的多环境配置文件 ④:选择②操作后编译生成的配置文件[去除其它环境配置文 ...
- Maven profile整合Spring profile
在Maven和Spring中,都有profile这个概念.profile是用于区分各种环境的,例如开发环境.测试环境.正式环境等.Maven的profile用于在打包时根据指定环境替换不同环境的配置文 ...
- aspect spring_使用Aspect和Spring Profile进行电子邮件过滤
aspect spring 在Web应用程序开发期间,经常需要发送电子邮件. 但是,有时数据库中会包含来自生产的数据,并且存在在电子邮件测试执行期间向真实客户发送电子邮件的风险. 这篇文章将解释如何避 ...
- Spring Profile模式示例
最近,我们介绍了Spring Profiles的概念. 此概念是针对不同部署环境的轻松配置区分符. 直接的用例(已提出)是对相关类进行注释,以便Spring根据活动的配置文件加载适当的类. 但是,这种 ...
- 使用Aspect和Spring Profile进行电子邮件过滤
在Web应用程序开发期间,经常需要发送电子邮件. 但是,有时数据库中会包含来自生产的数据,并且存在在电子邮件测试执行期间向真实客户发送电子邮件的风险. 这篇文章将解释如何避免在没有在发送电子邮件功能中 ...
- 补习系列(22)-全面解读 Spring Profile 的用法
目录 一.简介 二. 区分Bean对象 三. 设置Profile 3.1 WebApplicationInitializer接口 3.2 通过 web.xml定义 3.3 JVM启动参数 3.4 环境 ...
- maven+spring mvc+mybatis+redis+dubbo+zookeeper
2019独角兽企业重金招聘Python工程师标准>>> 黎孟阳 随笔 - 6, 文章 - 0, 评论 - 0, 引用 - 0 maven+spring mvc+mybatis+red ...
- spring boot 构建docker镜像,运行指定spring profile
#本文基于maven构建的spring boot项目,打包docker镜像需要安装docker 1.pom.xml添加docker打包插件 <plugin><groupId>c ...
最新文章
- 解决matplotlib库在PyCharm和命令行都无法正常显示问题
- 2019年第十届蓝桥杯 - 省赛 - C/C++大学B组 - D. 数的分解
- Array的javascript数据结构描述
- python爬虫视频课程推荐_Python 爬虫实战案例(推荐小白研究)
- 【Android 10 源码】深入理解 MediaCodec configure
- wps小写金额转大写快捷键_WPS轻松办公—将数字转换中文大写的两种方法
- 板簧的弹性系数如何计算_一种板簧总成的刚度计算方法、系统及可读存储介质与流程...
- 针对灰产外挂的分析与研究
- edk2中的fdf文件简介
- 404 Note Found队 Alpha7
- tensorrt,mmclas中的onnx转tensorrt
- 【无标题】Java画板简易实现
- GoLand ide编辑器设置方法注释模板(例如author,date)
- MVP Open Day- 微软社区大课堂招募学生啦
- 关于socket长连接的心跳包
- 递归函数c语言结束条件,满足动态条件时退出递归函数
- 基于51单片机的EEPROM读写
- 2. 内核解压-关中断进入svc模式
- 数值计算方法-算法设计及其MATLAB实现
- Python求数组的自然间断点