我的 src/test/resources 中有很多子文件夹,我想做的是使用 src/test/filters 中的特定过滤器文件过滤每个子文件夹:
我试过这样的事情:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>default-testResources</id>
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
<configuration>
<resources>
<resource>
<outputDirectory>${basedir}/target/annonce</outputDirectory>
<directory>${basedir}/src/test/resources/annonce</directory>
<filtering>true</filtering>
</resource>
</resources>
<filters>
<filter>${basedir}/src/test/filters/annonce/filter.properties</filter>
</filters>
</configuration>
</execution>
<execution>
<id>default-testResources</id>
<phase>process-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/profil</outputDirectory>
<overwrite>true</overwrite>
<resources>
<resource>
<directory>${basedir}/src/test/resources/profil</directory>
<filtering>true</filtering>
</resource>
</resources>
<filters>
<filter>${basedir}/src/test/filters/profil/filter.properties</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
但是我得到一个错误,说 id 应该是唯一的。我试图用于第二次执行copy-resources
id
,goal
但它不起作用,所以我想知道是否有任何想法?