maven的mvn clean package打包xml文件中的占位符解析原因
<build><filters><filter>${user.home}/love.properties</filter></filters> <finalName>love-web</finalName><resources><resource><directory>src/main/resources</directory><filtering>true</filtering><includes><include>**/*</include></includes></resource><resource><directory>src/main/java</directory><includes><include>**/*.xml</include></includes></resource></resources> </build>
?<filtering>true</filtering> 这个配置的意思是过滤掉src/main/resources文件夹下面的任意文件和src/main/java的文件夹下面的xml文件中的占位符,占位符是以 ${变量名称}形式,maven会自动读取配置文件,然后解析其中的占位符,使用love.properties文件中定义的属性进行替换