码迷,mamicode.com
首页 > 其他好文 > 详细

Maven 工程从一个properties 用属性占位符引用另一个properties的内容

时间:2017-09-07 19:25:44      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:路径   文件   分享   pom   contex   resources   .com   获取   内容   

1、pom xml 配置

  <!--filter-->
  <build>
    <filters>
      <filter>src/main/resource/test.properties</filter><!--基础文件-->
    </filters>

    <resources>
      <resource>
        <directory>src/main/resource</directory><!--需要过滤的路径,该路径下文件可以通过属性占位符获取 filter 的内容-->
        <filtering>true</filtering>
      </resource>
    </resources>
  </build>

2、 项目结构

技术分享

 

两个文件的内容

技术分享

技术分享

3、编译项目,编译后的目录结构

技术分享

classes 类路径下context.text 的内容

技术分享

 

Maven 工程从一个properties 用属性占位符引用另一个properties的内容

标签:路径   文件   分享   pom   contex   resources   .com   获取   内容   

原文地址:http://www.cnblogs.com/ruanzw/p/7491024.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!