I have a bunch of modules in my setup, and I'd like to copy a file to each of these modules. As copying is mostly done by using maven-assembly-plugin
, I'd like to use it here as well.
However, I noticed that the plugin does not allow any loop mechanism such as for-each or so. Therefore when we have, let's say, 50 modules, we have to repeat coding fileSet
tag 50 times, which looks lame and unprofessional.
For instance, consider the below descriptor. The snippet copies the config.properties
file to one of the modules (project.base
). However, I have a lot of modules in my setup, so I need to do the same operation for each of them. This leads to a situation where I need to copy-paste the fileSet
50 times, which is outrageous.
<fileSets>
<fileSet>
<directory>config</directory>
<outputDirectory>../project.base</outputDirectory>
<lineEnding>unix</lineEnding>
<filtered>true</filtered>
<includes>
<include>config.properties</include>
</includes>
<excludes>
<exclude>**/*</exclude>
</excludes>
</fileSet>
<!-- Same to be repeat for every module here-->
</fileSets>
Is there a way to automate this? Or was it designed to operate this way?