1、创建需要读取的properties文件

maven profile java 读取properties maven项目读取配置文件_properties文件

maven profile java 读取properties maven项目读取配置文件_加载_02

2、在xml文件中加载配置文件

<!-- 加载配置文件 -->
<context:property-placeholder location="classpath:conf/resource.properties" />

3、使用@Value注解调用该属性

maven profile java 读取properties maven项目读取配置文件_项目中问题_03