maven profile: Step by Step
来源:互联网 发布:mac spss 24破解dmg 编辑:程序博客网 时间:2024/06/15 19:10
During the lifecircle of development, we need some different config profiles for different enviroments. Such as the dev, bts, prod enviroments. Here we will see how to create maven profile forvariety enviroments.
Step 1: config theprofile of POM.xml
Tips: we define 3 enviroments: dev, bts, prod. The dev is default to active(config by activeByDefault), if profiles are not specified, use the default profile config.
profiles.active means the config file directory for the active profile
Step 2: The project directory
Tips: The config files are different from different environments. We should put this files toresouces directory of maven's project(src/main/resources) . The common resources file put to the src/main/resources.
The config file (du.properties,dataservices) of dev is put to src/main/resources/dev
The config file (du.properties,dataservices) of btss put to src/main/resources/bts
Step 3: Thebuild config in pom.xml
Tips: First-node ofresource need to exclude all of different config file for diffrent environments. The config for different environments is defined in second-node ofresource.
e.g. If the current active profile isdev, then the ${profileds.active} will be interpolated todev. Then the active direcotry issrc/main/resources/dev.
Step 4: build project using profile
(1) in Intellij Idea, u can see checked the profile box inmaven-profile-view
(2) u can also use the compile line such as: mvn intall -P dev
阅读全文
0 0
- maven profile: Step by Step
- eclipse构建Maven项目 (step-by-step)
- 5分钟学懂Maven(step by step)
- NHibernate Step by Step
- OGRE step by step
- step by step
- MinGW Step by Step
- 大杂烩---Step by Step
- sphinx4 STEP BY STEP
- EJB step by step
- NHibernate Step by Step
- Django Step by Step
- Eclipse: Step by Step
- step by step
- ALE STEP BY STEP
- [Design]Step by Step
- Makefile step by step
- rails step by step
- 冒泡排序
- java 内存设置
- NestedScrollWebview实现与优化
- 机器学习技法系列三
- WIN8及以上开机为什么会超快?UEFI BIOS引导作用大。
- maven profile: Step by Step
- hdu 6168 Numbers
- 使用cmake把代码移植到MinGW的总结
- 解决 502、504 Gateway Time-out(nginx)
- JQ模糊匹配(类似百度搜索等)
- 使用Spring的ResourceLoader获取文件夹在主机的实际位置(windows和linux通用)
- 数据结构实验之图论一:基于邻接矩阵的广度优先搜索遍历
- [WebGL入门]三十一,Quaternions(四元数)
- STORM入门之(集成ElasticSearch)