File collector plugin

The File collector plugin is used to copy selected resources (files and/or directories) from partly known directory paths. Search expressions are written Ant-style.

Example task
Copy all Java sources (main and test) and the package descriptions into one directory but prevent losing the package path. You are in directory modules where a lot of artifacts are placed. These artifacts can be pom or non-pom artifacts i.e. they can have child artifacts. The target directory is target/aggregated-files. Each Java source file must be unique in the target path.

Here is the configuration for the task described above:

    <plugin>
        <groupId>ch.elca.el4j.maven.plugins</groupId>
        <artifactId>maven-file-collector-plugin</artifactId>
        <configuration>
            <rootSourceDirectory>modules</rootSourceDirectory>
            <sourceDirectoryIncludePatterns>**/src/main/java,**/src/test/java</sourceDirectoryIncludePatterns>
            <sourceFileIncludePatterns>**/*.java,**/package.html</sourceFileIncludePatterns>
            <targetDirectory>target/aggregated-files</targetDirectory>
            <allowOverwrite>false</allowOverwrite>
        </configuration>
    </plugin>

For detailed usage see the plugin info page.