使用maven创建公共输出zip文件
我有3个模块,它们链接到与此类似的父项目使用maven创建公共输出zip文件,maven,maven-2,maven-plugin,maven-assembly-plugin,Maven,Maven 2,Maven Plugin,Maven Assembly Plugin,我有3个模块,它们链接到与此类似的父项目 root (pom.xml) +--- mod1 (pom.xml) +--- mod2 (pom.xml) +--- mod3 (pom.xml) 我在mod1的config文件夹中有一些配置文件。我在mod2的config文件夹中有其他配置文件。我想将所有这些配置文件放在输出zip文件的一个公用文件夹中 这有可能吗是的,有可能。您必须将执行添加到构建过程中的最后一个模块(我假设在您的案例中是mod3)并添加程序集描述符,有点像这样
root (pom.xml)
+--- mod1 (pom.xml)
+--- mod2 (pom.xml)
+--- mod3 (pom.xml)
我在mod1的config文件夹中有一些配置文件。我在mod2的config文件夹中有其他配置文件。我想将所有这些配置文件放在输出zip文件的一个公用文件夹中
这有可能吗是的,有可能。您必须将执行添加到构建过程中的最后一个模块(我假设在您的案例中是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>
拉链
../mod1/config
配置
../mod2/config
配置
这很有效。但是,如何在java代码中进行更改以指向新位置