1. pom.xml定义属性

<properties>
<project.version>0.1.1</project.version>
</properties>



2. pom.xml配置,使用变量替换


<resources>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>



3. spring的applicationContext.xml使用变量


<bean id="ProjectUtil" class="com.pandy.framework.base.utils.ProjectUtil">
<property name="projectVersion">
<value>${project.version}</value>
</property>
</bean>