<build> <resources> <resource> <directory>${project.basedir}/src/main/resources</directory> <!--为主资源目录开启过滤--> <filtering>true</filtering> </resource> </resources> <testResources> <testResource> <directory>${project.basedir}/src/test/resources</directory> <!--为测试资料目录开启过滤功能--> <filtering>true</filtering> </testResource> </testResources> </build>