Maven 配置打不同环境的版本包
Maven 提供了丰富的插件,本文说明了maven 插件打包的步骤:
pom.xml 文件如下:
<profiles><!-- dev环境 --><profile><id>dev</id><build><filters><filter>log4j.dev.properties</filter><filter>params.dev.properties</filter></filters><resources><resource><directory>src/main/resources</directory><includes><include>log4j.properties</include><include>params.properties</include><include>dictionary.properties</include></includes><filtering>true</filtering></resource><resource><directory>src/main/resources</directory><excludes><exclude>log4j.properties</exclude><exclude>params.properties</exclude></excludes><filtering>false</filtering></resource></resources></build><activation><activeByDefault>true</activeByDefault><property><name>env</name><value>dev</value></property></activation></profile><!-- pro环境 --><profile><id>pro</id><build><filters><filter>log4j.pro.properties</filter><filter>params.pro.properties</filter></filters><resources><resource><directory>src/main/resources</directory><includes><include>log4j.properties</include><include>params.properties</include><include>dictionary.properties</include></includes><filtering>true</filtering></resource><resource><directory>src/main/resources</directory><excludes><exclude>log4j.properties</exclude><exclude>params.properties</exclude></excludes><filtering>false</filtering></resource></resources></build></profile><!-- uat环境 --><profile><id>uat</id><build><filters><filter>log4j.uat.properties</filter><filter>params.uat.properties</filter></filters><resources><resource><directory>src/main/resources</directory><includes><include>log4j.properties</include><include>params.properties</include><include>dictionary.properties</include></includes><filtering>true</filtering></resource><resource><directory>src/main/resources</directory><excludes><exclude>log4j.properties</exclude><exclude>params.properties</exclude></excludes><filtering>false</filtering></resource></resources></build></profile> </profiles>
params.dev.properties 是指在项目里配置的开发环境数据链接
params.uat.properties 是指在项目里配置的测试环境数据链接
params.pro.properties 是指在项目里配置的生产环境数据链接
params.properties 是指上面三个指定的打包的数据链接
Maven 配置打不同环境的版本包相关推荐
- IDEA下使用maven配置Spark开发环境
IDEA下使用maven配置Spark开发环境 1.安装Java 2.配置环境变量 3.配置Hadoop环境 4.安装Scala插件 5.配置maven 4.Spark编程 Spark测试 使用到的软 ...
- eclipse下使用maven配置库托管jar包
1.项目是通过maven配置库托管jar包 首先要保证maven配置库中有相应的jar包才能通过这个方法来添加jar包.maven的有点就是把要用到的jar包统一放在一个配置库中,在某个项目需要用到这 ...
- Java项目管理工具:maven配置详解
目录 一.maven概述 二.maven仓库 三.maven工程 最后 今天是刘小爱自学Java的第98天. 感谢你的观看,谢谢你. 话不多说,开始今天的学习: 经过97天的学习,对于JavaSE.数 ...
- 在idea上配置hadoop开发环境,使用maven配置hadoop的依赖,自动管理相关jar包
使用maven可以很方便的管理我们项目的依赖,不需要手动去加载项目依赖的ja包,也方便项目的迁移,所以我选择使用 maven 来管理hadoop的开发环境的jar包. maven官网 JDK版本的要求 ...
- SonarQube在Windows环境下下载安装,中文包下载安装,mysql配置,maven配置,idea配置,项目配置
SonarQube的历史版本下载地址:SonarQube历史版本下载地址 我的环境配置的是JDK8,安装SonarQube的版本是7.5 ** 1.SonarQube的Windows环境的安装 ** ...
- Hadoop完全分布式搭建过程、maven和eclipse配置hadoop开发环境、配置Map/Reduce Locations、简单wordcount测试!
Hadoop完全分布式搭建及测试 项目开始前准备工作 1.下载并安装VM workstation pro 15安装包,这里选择: VMware-workstation-full-15.1.0-1359 ...
- Maven配置完毕后构建失败,无法下载JAR包,输入mvn help:system后出现No plugin found for prefix ‘help‘...问题的解决方案
这个问题困扰了我很久,找了很多解决方案,但还是一直无法解决.我在虚拟机中按照标准步骤配置了很多次,每次都能够成功,但一在物理机中,相同的配置步骤带来的结果却总是配置失败,在cmd中输入mvn help ...
- maven学习(下)利用Profile构建不同环境的部署包
2019独角兽企业重金招聘Python工程师标准>>> 接上回继续,项目开发好以后,通常要在多个环境部署,象我们公司多达5种环境:本机环境(local).(开发小组内自测的)开发环境 ...
- Anaconda多环境多版本python配置指导
Anaconda多环境多版本python配置指导: http://www.jianshu.com/p/d2e15200ee9b 原博客是翻译的官方文档,再加上自己的部分内容,官方原文地址:http:/ ...
最新文章
- [ZJOI2019]线段树
- python安装pip-安装pip的三种方法
- 如何取得Win7文件的管理员权限?
- 如何修改远程桌面连接3389端口
- 【MVC】AJAX+PartialView实现商城首页的楼层加载
- 为什么现在越来越多的人买手机都喜欢从官网购买,而不从实体店买?
- [Java] 蓝桥杯ADV-208 算法提高 矩阵相乘
- 为什么不能在lock语句的主体内使用#39;await#39;运算符?
- java x1价格_java I/O总结
- 古今中外数学思想__读书笔记
- VBM后的配对t检验以及xjview使用
- 苹果笔记本电脑我的计算机在哪里设置密码,苹果笔记本忘记密码怎么办
- 20.数据集成、数据整合、数据融合
- pytroch教程(一)
- 简要介绍各种键盘布局
- 【轻博客观察之二】十问Tumblr
- KO88冲销内部订单结算的操作参考
- 摄影_焦点、对焦、对焦点
- 微电影制作迅速走红的原因
- Linux中更改文件显示只读不可写