sass:update-stylesheets

Full name:

org.jasig.maven:sass-maven-plugin:1.1.1:update-stylesheets

Description:

Mojo that compiles SASS Templates into CSS files. Uses JRuby to execute a generated script that calls the SASS GEM

Attributes:

  • Requires a Maven project to be executed.
  • Binds by default to the lifecycle phase: process-sources.

Required Parameters

Name Type Since Description
sassSourceDirectory File - Directory containing SASS files, defaults to the Maven Web application sources directory (src/main/webapp)
Default value is: ${basedir}/src/main/webapp.

Optional Parameters

Name Type Since Description
buildDirectory File - Build directory for the plugin.
Default value is: ${project.build.directory}.
destination File - Where to put the compiled CSS files
Default value is: ${project.build.directory}/${project.build.finalName}.
excludes String[] - Defines which of the included files in the source directories to exclude (none by default).
failOnError boolean - Fail the build if errors occur during compilation of sass/scss templates.
Default value is: true.
gemPaths String[] - Defines paths where jruby will look for gems. E.g. a maven build could download gems into ${project.build.directory}/rubygems and a gemPath pointed to this directory. Finally, individual gems can be loaded via the <gems> configuration.
Default value is: ${project.build.directory}/rubygems.
gems String[] - Defines gems to be loaded before Sass/Compass. This is useful to add gems with custom Sass functions or stylesheets. Gems that hook into Compass are transparently added to Sass' load_path.
includes String[] - Defines files in the source directories to include Defaults to: "**/scss"
relativeOutputDirectory String - Defines an additional path section when calculating the destination for the SCSS file. Allows, for example "/media/skins/universality/coal/scss/portal.scss" to end up at "/media/skins/universality/coal/portal.css" by specifying ".."
Default value is: ...
resources List - Sources for compilation with their destination directory containing SASS files. Allows for multiple resource sources and destinations. If specified it precludes the direct specification of sassSourceDirectory/relativeOutputDirectory/destination parameters.
Example configuration
     <resource>
         <source>
             <directory>${basedir}/src/main/webapp</directory>
             <includes>
                 <include>**/scss</include>
             </includes>
         </source>
         <relativeOutputDirectory>..</relativeOutputDirectory>
         <destination>${project.build.directory}/${project.build.finalName}</destination>
     </resource>

sassOptions Map - Defines options for Sass::Plugin.options. See html.options If the value is a string it must by quoted in the maven configuration: <cache_location>'/tmp/sass'</cache_location>
If no options are set the default configuration set is used which is:
<unix_newlines>true</unix_newlines>
<cache>true</cache>
<always_update>true</always_update>
<cache_location>${project.build.directory}/sass_cache</cache_location>
<style>:expanded</style>

useCompass boolean - Enable the use of Compass style library mixins, this emulates the --compass commandline option of Sass.
Default value is: false.

Parameter Details

buildDirectory:

Build directory for the plugin.
  • Type: java.io.File
  • Required: No
  • Expression: ${buildDirectory}
  • Default: ${project.build.directory}

destination:

Where to put the compiled CSS files
  • Type: java.io.File
  • Required: No
  • Expression: ${encoding}
  • Default: ${project.build.directory}/${project.build.finalName}

excludes:

Defines which of the included files in the source directories to exclude (none by default).
  • Type: java.lang.String[]
  • Required: No

failOnError:

Fail the build if errors occur during compilation of sass/scss templates.
  • Type: boolean
  • Required: No
  • Default: true

gemPaths:

Defines paths where jruby will look for gems. E.g. a maven build could download gems into ${project.build.directory}/rubygems and a gemPath pointed to this directory. Finally, individual gems can be loaded via the <gems> configuration.
  • Type: java.lang.String[]
  • Required: No
  • Default: ${project.build.directory}/rubygems

gems:

Defines gems to be loaded before Sass/Compass. This is useful to add gems with custom Sass functions or stylesheets. Gems that hook into Compass are transparently added to Sass' load_path.
  • Type: java.lang.String[]
  • Required: No

includes:

Defines files in the source directories to include Defaults to: "**/scss"
  • Type: java.lang.String[]
  • Required: No

relativeOutputDirectory:

Defines an additional path section when calculating the destination for the SCSS file. Allows, for example "/media/skins/universality/coal/scss/portal.scss" to end up at "/media/skins/universality/coal/portal.css" by specifying ".."
  • Type: java.lang.String
  • Required: No
  • Default: ..

resources:

Sources for compilation with their destination directory containing SASS files. Allows for multiple resource sources and destinations. If specified it precludes the direct specification of sassSourceDirectory/relativeOutputDirectory/destination parameters.
Example configuration
     <resource>
         <source>
             <directory>${basedir}/src/main/webapp</directory>
             <includes>
                 <include>**/scss</include>
             </includes>
         </source>
         <relativeOutputDirectory>..</relativeOutputDirectory>
         <destination>${project.build.directory}/${project.build.finalName}</destination>
     </resource>
  • Type: java.util.List
  • Required: No

sassOptions:

Defines options for Sass::Plugin.options. See html.options If the value is a string it must by quoted in the maven configuration: <cache_location>'/tmp/sass'</cache_location>
If no options are set the default configuration set is used which is:
<unix_newlines>true</unix_newlines>
<cache>true</cache>
<always_update>true</always_update>
<cache_location>${project.build.directory}/sass_cache</cache_location>
<style>:expanded</style>
  • Type: java.util.Map
  • Required: No

sassSourceDirectory:

Directory containing SASS files, defaults to the Maven Web application sources directory (src/main/webapp)
  • Type: java.io.File
  • Required: Yes
  • Default: ${basedir}/src/main/webapp

useCompass:

Enable the use of Compass style library mixins, this emulates the --compass commandline option of Sass.
  • Type: boolean
  • Required: No
  • Default: false