This example shows usage of the appending combiner to combine resources together into a single file.
In this example, all files with a name matching file*.txt in the src/main/resources are read. All the newlines in these files are stripped out and the are files concatenated together with two newlines following the contents of each resource (so the output file will have two newlines at the end of it). The combination is then written out to the combined-files.txt file in the build directory (target). See below for the contents of each file
<plugin> <groupId>com.github.jasonmfehr</groupId> <artifactId>combiner-maven-plugin</artifactId> <version>1.0.0-beta-05</version> <configuration> <combinations> <combination> <id>append-files</id> <inputResources> <includes> <include>src/main/resources/file*.txt</include> </includes> </inputResources> <transformers> <transformer>StripNewlines</transformer> </transformers> <combiner>AppendingCombiner</combiner> <outputDestination>combined-files.txt</outputDestination> <settings> <appendingCombinerNewlines>2</appendingCombinerNewlines> </settings> </combination> </combinations> </configuration> </plugin>
In these files a \n denotes a line break, not the literal characters. Also, the order that the resources are actually combined by the plugin may not be the order reflected here.
This is the text of file foo. Let's\n \n insert some\n \n completely random line\n \n breaks.\n \n \n