我正在尝试将 Maven 模块中的特定目录添加到我的构建中。我相信 fileSets
是返回此的方法。
我希望有一种清晰简洁的方式使用 fileSets
从 Maven 模块获取必要的目录,这些模块只包含一个包含一些必要资源的目录。
最佳答案
如果您想包含整个模块,请使用 moduleSets,但如果您想选择要添加的文件,您可以在顶级项目的程序集配置文件中使用 fileSets,如下所示:
<fileSets>
<fileSet>
<directory>${basedir}/myModule/src/main/resources</directory>
<includes>
<include>*.txt</include>
</includes>
</fileSet>
</fileSets>
关于maven-2 - 将 <fileSets> 与 Maven 程序集一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3737381/