更新时间:2023-11-27 18:14:46
您可以使用 Maven资源插件.
以他们的文档中的示例为例:
As an example taken from their documentation:
<project>
...
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target/extra-resources</outputDirectory>
<resources>
<resource>
<directory>src/non-packaged-resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
...
</build>
...
</project>
如果我没记错的话,这会将directory
的内容复制到outputDirectory
中.
This would copy the content of the directory
into the outputDirectory
if I'm not mistaken.