首页 > 其他 > 详细

maven 不同环境加载不同的properties 文件

时间:2015-11-30 12:54:48      阅读:292      评论:0      收藏:0      [点我收藏+]

http://haohaoxuexi.iteye.com/blog/1900568 //参考文章

实际项目中pom配置如下

<profiles>
<profile>
<id>dev</id>
<properties>
<profile.environment>dev</profile.environment>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>online</id>
<properties>
<profile.environment>online</profile.environment>
</properties>
</profile>
</profiles>

 

maven 构建项目的参数如下

clean jetty:run -Pdev   //-P指定读取的文件,为测试环境

clean jetty:run -Ponline   //-P读取online 下的文件,正式的部署环境

maven 不同环境加载不同的properties 文件

原文:http://www.cnblogs.com/lilefordream/p/5006743.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!