Fork me on GitHub


This document is intended to provide instructions for using the CSS Splitter Maven Plugin.

In order for this discussion to be useful, it's critical to cover two topics:

  1. Configuring your project's pom.xml to run the plugin during the project's build cycle
  2. Invoking the plugin from the command-line

Configuring Plugin

By tying the goals of the plugin to a phase in the build cycle, the specified goals will run each time that phase of the build cycle is executed. Doing this can make it easier to add the plugin to your project, because it eliminates the need to run the plugin standalone.

To bind the split goal of the CSS Splitter Maven Plugin to a phase in the build cycle, you will need to add the execution tag with the goal set to split. Optionally, you can bind the plugin to a different build phase by using the phase option. For instance, using generate-sources in the phase option will force the split goal to run each time this phase of the build cycle occurs.

For a complete list of the available configuration options see css-splitter:split goal overview page.

                  <phase>generate-sources</phase> <!-- When omitted defaults to 'process-sources' -->
                     <!-- put your configurations here -->

If you want to use snapshot, then you need to add the repository to your pom.xml:

      <name>Sonatype's SNAPSHOT repository</name>

Invoke from the command-line

The goals for the CSS Splitter Maven Plugin are bound to their respective phases in the build lifecycle. To split your sources, you need only to tell Maven until which lifecycle to execute. The following will split your sources:

mvn process-sources

You can also split CSS sources by executing only this plugin:

mvn biz.gabrys.maven.plugins:css-splitter-maven-plugin:split