需要设定profile和build
<profiles> <profile> <id>develop</id> <properties> <profiles.active>develop</profiles.active> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <id>preview</id> <properties> <profiles.active>preview</profiles.active> </properties> </profile> <profile> <id>release</id> <properties> <profiles.active>release</profiles.active> </properties> </profile> </profiles>
<resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <excludes> <exclude>config/**</exclude> <exclude>static/assets/**</exclude> </excludes> </resource> <resource> <directory>src/main/resources/config/${profiles.active}</directory> <targetPath>.</targetPath> <filtering>true</filtering> </resource> <!-- <resource> --> <!-- <directory>src/main/resources</directory> --> <!-- <filtering>false</filtering> --> <!-- <includes> --> <!-- <include>static/assets/**</include> --> <!-- </includes> --> <!-- </resource> --> </resources>