Grails - Using a specific version of LessCSS with lesscss-resources

Posted on March 11, 2013 in JVM • 1 min read

A few days ago I was trying to integrate the twitter-bootstrap Grails plugin into an app but was having difficulty getting the less sources to play nice with the lesscss-resources plugin.

It turned out that the most recent version of bootstrap used LessCSS syntax that is only available in the 1.3.3 version of the lesscss compiler. The lesscss-resources depends on version 1.3.1, so to work around that issue you can update your BuildConfig.groovy settings to the following to force a specific version of the lesscss compiler:

grails.project.dependency.resolution = {
    dependencies {
        runtime ('org.lesscss:lesscss:1.3.3')
    }
    plugins {
        compile(":lesscss-resources:1.3.1") {
            excludes "lesscss"
        }
    }
}