As stated in the maven-assembly-plugin documentation:
If your project wants to pack your artifact in uber-jar, the build plugin provides only basic support. For more control, use the Maven Shade Plugin .
Using the maven-shade-plugin , you can have a fat jar (for example, using the build plugin) and solve similar problems with file merging using Resource Transformers . In your case, AppendingTransformer will merge files with the same name, but with different content.
Some banks contain additional resources (such as property files) that have the same file name. To avoid overwriting, you can choose to merge them by adding their contents to a single file.
A simple configuration would look like this:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>2.4.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> <resource>path/to/file/file-name-here</resource> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build>
Update
You do not need an external build descriptor for the hue plugin; you can directly configure your requirements as a plugin configuration.
In your case, to exclude resources from collected cans, you can use hue filters .
A simple configuration (which will be combined with the above) will look like this:
<configuration> <filters> <filter> <artifact>*:*</artifact> <excludes> <exclude>**/*Resources_*</exclude> <exclude>**/*ErrorsText_*</exclude> </excludes> </filter> </filters> </configuration>
source share