我有 3 个模块,它们链接到与此类似的父项目。
root (pom.xml)
+--- mod1 (pom.xml)
+--- mod2 (pom.xml)
+--- mod3 (pom.xml)
我在 mod1 的 config 文件夹中有一些配置文件。我在mod2的config文件夹中有其他配置文件。我想将所有这些配置文件放在输出 zip 文件的一个公共(public)文件夹中。
这可能吗
最佳答案
是的,这是可能的。您必须添加maven-assembly-plugin执行到构建过程中的最后一个模块(我假设在你的情况下它是 mod3)并添加程序集描述符,有点像这样:
<assembly>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>../mod1/config</directory>
<outputDirectory>config</outputDirectory>
</fileSet>
<fileSet>
<directory>../mod2/config</directory>
<outputDirectory>config</outputDirectory>
</fileSet>
</fileSets>
</assembly>
关于maven - 使用 Maven 创建通用输出 zip 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11882058/