springmvc多环境配置-profiles
1 pom.xml 添加 profiles 标签
<profiles>
<!--pro 线上环境-->
<profile>
<id>hdapp_pro</id>
<properties>
<db.main.url>jdbc:oracle:thin:@ip:1521:orcl</db.main.url>
<db.mian.username>username</db.mian.username>
<db.main.password>password</db.main.password>
</properties>
<activation> 配置默认使用哪个环境
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-开发环境环境-->
<profile>
<id>hdapp_dev</id>
<properties>
<db.main.url>jdbc:oracle:thin:@ip:1521:orcl</db.main.url>
<db.mian.username>username</db.mian.username>
<db.main.password>password</db.main.password>
</properties>
</profile>
</profiles>
2 在resources 下新配置文件 jdbc.properties 内容如下
jdbc.url = ${db.main.url}
jdbc.username =${db.mian.username}
jdbc.password =${db.main.password}
3 在pom.xml build 中添加扫描的文件
<build>
<resources>
<resource>
<directory>src/main/resources/</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources/</directory>
<includes> //可以写多个
<include>config/jdbc.properties</include>
<include>quartz/scan-quartz.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
4 打包时指定profiles 即可
打包命令添加参数 -P
clean package -P hdapp_dev
springmvc多环境配置-profiles的更多相关文章
- idea spring+springmvc+mybatis环境配置整合详解
idea spring+springmvc+mybatis环境配置整合详解 1.配置整合前所需准备的环境: 1.1:jdk1.8 1.2:idea2017.1.5 1.3:Maven 3.5.2 2. ...
- Shiro笔记(二)Shiro集成SpringMVC的环境配置
0.pom文件引入 <!-- SECURITY begin --> <dependency> <groupId>org.apache.shiro</group ...
- spring程序打包war,直接通过-jar启动,并指定spring.profiles.active参数控制多环境配置
备注:spring boot有内嵌tomcat,jar项目可以用java -jar命令启动,war包也可以,且可以直接指定spring.profiles.active参数控制多环境配置 直接指定传参, ...
- maven profiles多环境配置
maven profiles多环境配置 转载. https://blog.csdn.net/runbat/article/details/81747874 今天做了一个小项目,需要配置开发.测试.预发 ...
- SpringBoot Profiles 多环境配置及切换
目录 前言 默认环境配置 多环境配置 多环境切换 小结 前言 大部分情况下,我们开发的产品应用都会根据不同的目的,支持运行在不同的环境(Profile)下,比如: 开发环境(dev) 测试环境(tes ...
- Maven2-profile多环境配置
使用maven管理项目有一个好处是就是可以针对不同的环境使用不同的编译打包设置,方便了多环境下的打包部署,一般我们开发项目都会有至少开发环境和正式环境两个,针对这两个环境的配置信息也会有所不同,比如数 ...
- Maven-001-初识及本地环境配置
前段时间想对自己之前写的一些代码或者小工具,因为写的比较乱,因而想系统的管理一下自己学习 Java 时写的源码,经过多方请教.网上查询,最终决定使用 Maven 来管理自己写的代码. Maven 是一 ...
- [转载] 高效MacBook工作环境配置
原文: http://www.xialeizhou.com/?p=71 高效MacBook工作环境配置 发表于 2015 年 8 月 1 日 由 xialeizhou 本文记录整个配置过程,供新入手M ...
- activiti自定义流程之自定义表单(一):环境配置
先补充说一下自定义流程整个的思路,自定义流程的目的就是为了让一套代码解决多种业务流程,比如请假单.报销单.采购单.协作单等等,用户自己来设计流程图. 这里要涉及到这样几个基本问题,一是不同的业务需求, ...
随机推荐
- <Array> 41 134
41. First Missing Positive 思路是把1放在数组第一个位置 nums[0],2放在第二个位置 nums[1],即需要把 nums[i] 放在 nums[nums[i] - 1] ...
- [LeetCode] 79. Word Search 词语搜索
Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from l ...
- Metasploit 常用命令手册
Installation curl https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/template ...
- nginx ubantu 安装步骤
Ubuntu14.04默认安装的是Nginx 1.4.6 如果已经安装,请先卸载sudo apt-get remove nginx最新的稳定版Nginx 1.6.0在ubuntuupdates ppa ...
- Windows 配置Apache+CGI
首先还是先在官网下载Apache,版本为Apache 2.4.26 x64,下载64位的地址为:http://www.apachehaus.com/cgi-bin/download.plx 下载完成后 ...
- 安卓 apk 嵌入H5页面只显示部分
安卓 apk 嵌入H5页面只显示部分(有空白页出现) 解决方案 没有加载的是js部分,需要在安卓那边加上一串代码 webView.getSetting().setDomStorageEnabled(t ...
- thinkphp区间查询、统计查询、SQL直接查询
区间查询 $data['id']=array(array('gt',4),array('lt',10));//默认关系是(and)并且的关系 //SELECT * FROM `tp_user` WHE ...
- Laravel手动分页的方法
use Illuminate\Pagination\LengthAwarePaginator; public function index(Request $request){ $list =[... ...
- axios源码入口以及公用方法
axios学习笔记(公用方法) 源码地址 找到入口文件 axios/lib/axios.js var utils = require('./utils'); var bind = require('. ...
- MySQL使用现状分析与优化
前言 再紧张的裁员氛围,也不该影响你学习的心态.不要本末倒置,技术永远不会落后,只要你还在学习的道路上,没有后退. 数据库架构 目前生产环境RDS是多区可用架构.数据库实例发生计划内或计划外的中断时, ...