libsass wrapper for maven
Java CSS
Latest commit 682cc46 Jan 3, 2017 @warmuuh committed on GitHub Merge pull request #47 from rottina/master
README Update
Permalink
Failed to load latest commit information.
src added include path to watch job Dec 18, 2016
.gitignore fixed path issue May 5, 2015
.travis.yml fixed travis to use java8 Feb 8, 2016
README.md README Update Jan 2, 2017
pom.xml prepare next release Dec 18, 2016

README.md

Libsass Maven Plugin Build Status Maven Central

Libsass Maven Plugin uses libsass to compile sass files. Uses jsass to interface with C-library.

Changelog:

  • 0.2.6 - upgraded libsass to 3.4.0
    • added libsass:watch goal to watch and recompile include directory - thansk to @lorenzodee
  • 0.2.5 - added copySourceToOutput, changed default outputstyle to 'nested', upgraded libsass to 3.3.6
  • 0.2.4 - fixed bug with empty spaces in path
  • 0.2.3 - upgrade to libsass 3.3.4
  • 0.2.2 - minor bugfixes, readded m2e lifecycle mapping
  • 0.2.1 - updated libsass to 3.3.3
  • 0.2.0 - switched native bindings to bit3 bindings (using libsass 3.3.2), java8-only
  • 0.1.7 - UTF8 encoding issue, used wrong file extension for sass style
  • 0.1.6 - added m2e eclipse intergation, thanks @dashorst
  • 0.1.5 - readded macOs binaries, thanks @tommix1987
  • 0.1.4 - added contained libsass-version to artifact-version (e.g. 0.1.4-libsass_3.2.4-SNAPSHOT).
    • switched to new libsass API (sass_context.h)
    • removed image_path option (because of #420)
    • added failOnError flag to skip errors and continue the build, if wanted
  • 0.1.3 - fixed #10 - multi-module projects
  • 0.1.2 - added PR #4, updated to libsass version 3.1 for windows, linux, macos - thanks to @npiguet, @ogolberg
  • 0.1.1 - scss files can now be placed in inputpath/ directly
  • 0.1.0 - changed artefact group to com.github.warmuuh

Installation

libsass-maven-plugin is available on central-repository since version 0.1.2

Usage

Configure plugin in your pom.xml:

<build>
   <plugins>
      <plugin>
         <groupId>com.github.warmuuh</groupId>
         <artifactId>libsass-maven-plugin</artifactId>
         <version><VERSION>-libsass_3.3.6</version>
         <executions>
            <execution>
               <phase>generate-resources</phase>
               <goals>
                  <goal>compile</goal>
               </goals>
            </execution>
         </executions>
         <configuration>
            <imgPath>../img</imgPath>
            <inputPath>${basedir}/src/main/sass/</inputPath>
            <outputPath>${basedir}/target/</outputPath>
            <includePath>${basedir}/src/main/sass/plugins/</includePath>
         </configuration>
      </plugin>
   </plugins>
</build>

Alternatively, you can use the watch goal to have the plugin watch your files and recompile on change:

mvn com.github.warmuuh:libsass-maven-plugin:<version>-libsass_3.4.0:watch

Configuration Elements

Element Default value Documentation
outputPath ${project.build.directory} The directory in which the compiled CSS files will be placed.
inputPath src/main/sass The directory from which the source .scss files will be read. This directory will be traversed recursively, and all .scss files found in this directory or subdirectories will be compiled.
includePath null Additional include path, ';'-separated
outputStyle nested Output style for the generlookated css code. One of nested, expanded, compact, compressed. Note that as of libsass 3.1, expanded and compact result in the same output as nested.
generateSourceComments false Emit comments in the compiled CSS indicating the corresponding source line. The default value is false.
generateSourceMap true Generate source map files. The generated source map files will be placed in the directory specified by sourceMapOutputPath.
sourceMapOutputPath ${project.build.directory} The directory in which the source map files that correspond to the compiled CSS will be placed
omitSourceMapingURL false Prevents the generation of the sourceMappingURL special comment as the last line of the compiled CSS.
embedSourceMapInCSS false Embeds the whole source map data directly into the compiled CSS file by transforming sourceMappingURL into a data URI.
embedSourceContentsInSourceMap false Embeds the contents of the source .scss files in the source map file instead of the paths to those files
inputSyntax scss Switches the input syntax used by the files to either sass or scss.
precision 5 Precision for fractional numbers
failOnError true should fail the build in case of compilation errors.
copySourceToOutput false copies all files from source directory to output directory

License

MIT License.