我有两个要使用 maven-resources-plugin 执行的复制任务。例如,我需要从复制config.yml
到src/main/resources
根文件夹并将所有文件夹内容从复制/src/main/resources/examples
到src/examples
.
root
/src
/main
/resources --> config.yml (to root)
/examples --> all folder contents (to /src/examples)
我发现的唯一一个解决方案是:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/config.yml</include>
</includes>
</resource>
<!-- <resource>
<directory>src/main/resources/examples</directory>
</resource> -->
</resources>
</configuration>
</execution>
</executions>
</plugin>
但我只能添加一个目标文件夹。