Fork me on GitHub

Using include/exclude patterns

You can decide which files from the source directory will be processed. Include and exclude patterns can be defined in two formats: Ant and regular expressions.

Ant patterns

Ant patterns is a default format. The following example includes files with js extension, but which are not located in ignored directory.

<project>
   ...
   <build>
      <plugins>
         ...
         <plugin>
            <groupId>biz.gabrys.maven.plugins</groupId>
            <artifactId>directory-content-maven-plugin</artifactId>
            <version>1.1.0</version>
            <executions>
               <execution>
                  <goals>
                     ...
                  </goals>
                  <configuration>
                     <includes>
                        <include>**/*.js</include>
                     </includes>
                     <excludes>
                        <exclude>ignored/**/*.*</exclude>
                     </excludes>
                     ...
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
<project>

Regular expressions patterns

You can use regular expressions to define include and exclude patterns. File path separator is always equal to /. The following example includes files with js extension, but which are not located in ignored directory.

<project>
   ...
   <build>
      <plugins>
         ...
         <plugin>
            <groupId>biz.gabrys.maven.plugins</groupId>
            <artifactId>directory-content-maven-plugin</artifactId>
            <version>1.1.0</version>
            <executions>
               <execution>
                  <goals>
                     ...
                  </goals>
                  <configuration>
                     <filesetPatternFormat>regex</filesetPatternFormat>
                     <includes>
                         <include>^.+\.js$</include>
                     </includes>
                     <excludes>
                         <exclude>^ignored/.+$</exclude>
                     </excludes>
                     ...
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
<project>