使用profile解决maven不同的环境deploy到不同的repositories
2016-03-14 16:05
363 查看
maven版本:3.3.9
一:修改apache-maven-3.3.9\conf\settings.xml 在profiles标签中,添加如下profile
以上的admin/123456为仓库的用户名/密码,请自行修改
二:
在项目的pom.xml里面添加
三:deploy
mvn clean deploy -Pproduction 表示deploy到正式环境
mvn clean deploy 或者 mvn clean deploy -Pdev 表示deploy到开发环境
一:修改apache-maven-3.3.9\conf\settings.xml 在profiles标签中,添加如下profile
<!-- 开发环境 (snapshots环境) --></span> <profile> <id>dev</id> <properties> <repository.id>dev</repository.id> <repository.name>Dev Repository</repository.name> <repository.url>http://admin:123456@192.168.1.101/content/repositories/snapshots/</repository.url> </properties> </profile> <!-- 正式环境(releases环境) --></span> <profile> <id>production</id> <properties> <repository.id>production</repository.id> <repository.name>Production Repository</repository.name> <repository.url>http://admin:123456@192.168.1.101/content/repositories/releases/</repository.url> </properties> </profile>
以上的admin/123456为仓库的用户名/密码,请自行修改
<!-- 默认启用dev环境 --> <activeProfiles> <activeProfile>dev</activeProfile> </activeProfiles>
二:
在项目的pom.xml里面添加
<distributionManagement> <repository> <id>${repository.id}</id> <name>${repository.name}</name> <url>${repository.url}</url> <layout>default</layout> </repository> </distributionManagement>
三:deploy
mvn clean deploy -Pproduction 表示deploy到正式环境
mvn clean deploy 或者 mvn clean deploy -Pdev 表示deploy到开发环境
相关文章推荐
- Andrew Ng机器学习笔记+Weka相关算法实现(一)梯度下降与回归方法
- javascript作用域链学习笔记
- Javascript学习笔记:闭包题解(3)
- Ubuntu下freeradius-server的安装
- node.js学习之react,redux,react-redux
- Android常用权限
- ThinkPHP框架安全实现分析
- 程序媛开练之Java之反射
- 【nodejs+ejs】如何给模板传参数?
- 时间util Calendar
- java 我的java学习之路 会议问题
- Android关机闹钟实现
- Servlet基础(一) Servlet基础和关键的API介绍
- pku1568 Find the Winning Move 完全极大极小搜索
- ruby--条件和循环
- 关于PHP安装中遇到的错误分析--无法启动wampapache服务
- 蓝桥杯 历届试题 打印图形
- context解释
- 台球类html5游戏的AI设计与核心算法的实现
- Linux性能监控工具nmon在SecureCRT下乱码解决方法