Fork me on GitHub

Using include/exclude patterns

You can decide which files from the source directory will be split. 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 css extension, but which are not located in vendors directory.

<project>
   ...
   <build>
      <plugins>
         ...
         <plugin>
            <groupId>biz.gabrys.maven.plugins</groupId>
            <artifactId>css-splitter-maven-plugin</artifactId>
            <version>1.2.0</version>
            <executions>
               <execution>
                  <goals>
                     <goal>split</goal>
                  </goals>
                  <configuration>
                     <includes>
                        <include>**/*.css</include> <!-- this is a default value -->
                     </includes>
                     <excludes>
                        <exclude>vendors/**/*.*</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 css extension, but which are not located in vendors directory.

<project>
   ...
   <build>
      <plugins>
         ...
         <plugin>
            <groupId>biz.gabrys.maven.plugins</groupId>
            <artifactId>css-splitter-maven-plugin</artifactId>
            <version>1.2.0</version>
            <executions>
               <execution>
                  <goals>
                     <goal>split</goal>
                  </goals>
                  <configuration>
                     <filesetPatternFormat>regex</filesetPatternFormat>
                     <includes>
                         <include>^.+\.css$</include> <!-- this is a default value -->
                     </includes>
                     <excludes>
                         <exclude>^vendors/.+$</exclude>
                     </excludes>
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
<project>