我的 Maven 项目的根目录中有一个资源文件。目录结构如下。
src/
pom.xml
resource_file
在 pom.xml 中,我将资源提到为:
<build>
<resources>
<resource>
<directory>.</directory>
<includes>
<include>resource_file</include>
</includes>
</resource>
</resources>
</build>
在 war 文件中,resource_file存在于WEB-INF/classes/resource_file. 我需要resource_file位于war文件的根目录。我可以解压缩war文件并将其resource_file移至根目录并再次创建war文件。但是,有没有办法通过 maven 本身来实现这一点?