# Less compile problems #30

Closed
opened this Issue Apr 17, 2012 · 41 comments

### 19 participants

I believe I'm following the customization instructions exactly, but still get a less compilation error on startup. I've installed the latest twitter-bootstrap and less-resources plugins. I've added to config.groovy:

grails.resources.modules = {

'custom-bootstrap' {
dependsOn 'bootstrap'
resource url:[dir: 'less', file: 'custombootstrap.less'], attrs:[rel: "stylesheet/less", type:'css']
}


}

custombootstrap.less:

@import "bootstrap.less";

Here are the errors:

| Error 2012-04-17 00:33:12,604 [pool-7-thread-1] ERROR resourceMappers.LessResourceMapper  - Error compiling less file: C:\Users\Phil\.grails\2.0.1\projects\ju
Message: unterminated string literal (<script>#17749)
Line | Method
->>  109 | runtimeError                  in org.mozilla.javascript.DefaultErrorReporter
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|     96 | error                         in     ''
|    146 | addError . . . . . . . . . .  in org.mozilla.javascript.Parser
|    532 | getToken                      in org.mozilla.javascript.TokenStream
|    172 | peekToken . . . . . . . . . . in org.mozilla.javascript.Parser
|   2245 | primaryExpr                   in     ''
|   1955 | memberExpr . . . . . . . . .  in     ''
|   1813 | unaryExpr                     in     ''
|   1742 | mulExpr . . . . . . . . . . . in     ''
|   1723 | addExpr                       in     ''
|   1703 | shiftExpr . . . . . . . . . . in     ''
|   1677 | relExpr                       in     ''
|   1633 | eqExpr . . . . . . . . . . .  in     ''
|   1622 | bitAndExpr                    in     ''
|   1611 | bitXorExpr . . . . . . . . .  in     ''
|   1600 | bitOrExpr                     in     ''
|   1588 | andExpr . . . . . . . . . . . in     ''
|   1576 | orExpr                        in     ''
|   1559 | condExpr . . . . . . . . . .  in     ''
|   1544 | assignExpr                    in     ''
|   1910 | argumentList . . . . . . . .  in     ''
|   2050 | memberExprTail                in     ''
|   1958 | memberExpr . . . . . . . . .  in     ''
|   1813 | unaryExpr                     in     ''
|   1742 | mulExpr . . . . . . . . . . . in     ''
|   1723 | addExpr                       in     ''
|   1703 | shiftExpr . . . . . . . . . . in     ''
|   1677 | relExpr                       in     ''
|   1633 | eqExpr . . . . . . . . . . .  in     ''
|   1622 | bitAndExpr                    in     ''
|   1611 | bitXorExpr . . . . . . . . .  in     ''
|   1600 | bitOrExpr                     in     ''
|   1588 | andExpr . . . . . . . . . . . in     ''
|   1576 | orExpr                        in     ''
|   1559 | condExpr . . . . . . . . . .  in     ''
|   1544 | assignExpr                    in     ''
|   1523 | expr . . . . . . . . . . . .  in     ''
|   1202 | statementHelper               in     ''
|    707 | statement . . . . . . . . . . in     ''
|    401 | parse                         in     ''
|    338 | parse . . . . . . . . . . . . in     ''
|   2368 | compileImpl                   in org.mozilla.javascript.Context
|   1359 | compileString . . . . . . . . in     ''
|   1348 | compileString                 in     ''
|   1101 | evaluateString . . . . . . .  in     ''
|     42 | compile                       in com.groovydev.LessCompilerService
|     34 | map . . . . . . . . . . . . . in LessResourceMapper
|    139 | invoke                        in org.grails.plugin.resource.mapper.ResourceMapper
|    128 | invokeIfNotExcluded . . . . . in     ''
|    587 | applyMappers                  in org.grails.plugin.resource.ResourceProcessor
|    533 | prepareResource . . . . . . . in     ''
|    602 | doCall                        in org.grails.plugin.resource.ResourceProcessor$_prepareSingleDeclaredResource_closure12 | 29 | addDeclaredResource . . . . . in org.grails.plugin.resource.util.ResourceMetaStore | 600 | prepareSingleDeclaredResource in org.grails.plugin.resource.ResourceProcessor | 625 | doCall . . . . . . . . . . . in org.grails.plugin.resource.ResourceProcessor$_prepareResourceBatch_closure14
|      8 | each                          in org.grails.plugin.resource.ResourceProcessorBatch
|    621 | prepareResourceBatch . . . .  in org.grails.plugin.resource.ResourceProcessor
|    804 | resourcesChanged              in     ''
|    800 | loadModules . . . . . . . . . in     ''
|   1056 | reloadAll                     in     ''
|    172 | doCall . . . . . . . . . . .  in ResourcesGrailsPlugin$_closure3 | 303 | innerRun in java.util.concurrent.FutureTask$Sync
|    138 | run . . . . . . . . . . . . . in java.util.concurrent.FutureTask
|    886 | runTask                       in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run . . . . . . . . . . . . . in '' ^ 662 | run in java.lang.Thread | Error 2012-04-17 00:33:13,618 [pool-7-thread-1] ERROR resourceMappers.LessResourceMapper - Error compiling less file: C:\Users\Phil\.grails\2.0.1\projects\ju ggernaut\tomcat\work\Tomcat\localhost\juggernaut\grails-resources\less\custombootstrap.less Message: missing ] after element list (<script>#17749) Line | Method ->> 109 | runtimeError in org.mozilla.javascript.DefaultErrorReporter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 96 | error in '' | 146 | addError . . . . . . . . . . in org.mozilla.javascript.Parser | 160 | reportError in '' | 2294 | primaryExpr . . . . . . . . . in '' | 1955 | memberExpr in '' | 1813 | unaryExpr . . . . . . . . . . in '' | 1742 | mulExpr in '' | 1723 | addExpr . . . . . . . . . . . in '' | 1703 | shiftExpr in '' | 1677 | relExpr . . . . . . . . . . . in '' | 1633 | eqExpr in '' | 1622 | bitAndExpr . . . . . . . . . in '' | 1611 | bitXorExpr in '' | 1600 | bitOrExpr . . . . . . . . . . in '' | 1588 | andExpr in '' | 1576 | orExpr . . . . . . . . . . . in '' | 1559 | condExpr in '' | 1544 | assignExpr . . . . . . . . . in '' | 1910 | argumentList in '' | 2050 | memberExprTail . . . . . . . in '' | 1958 | memberExpr in '' | 1813 | unaryExpr . . . . . . . . . . in '' | 1742 | mulExpr in '' | 1723 | addExpr . . . . . . . . . . . in '' | 1703 | shiftExpr in '' | 1677 | relExpr . . . . . . . . . . . in '' | 1633 | eqExpr in '' | 1622 | bitAndExpr . . . . . . . . . in '' | 1611 | bitXorExpr in '' | 1600 | bitOrExpr . . . . . . . . . . in '' | 1588 | andExpr in '' | 1576 | orExpr . . . . . . . . . . . in '' | 1559 | condExpr in '' | 1544 | assignExpr . . . . . . . . . in '' | 1523 | expr in '' | 1202 | statementHelper . . . . . . . in '' | 707 | statement in '' | 401 | parse . . . . . . . . . . . . in '' | 338 | parse in '' | 2368 | compileImpl . . . . . . . . . in org.mozilla.javascript.Context | 1359 | compileString in '' | 1348 | compileString . . . . . . . . in '' | 1101 | evaluateString in '' | 42 | compile . . . . . . . . . . . in com.groovydev.LessCompilerService | 34 | map in LessResourceMapper | 139 | invoke . . . . . . . . . . . in org.grails.plugin.resource.mapper.ResourceMapper | 128 | invokeIfNotExcluded in '' | 587 | applyMappers . . . . . . . . in org.grails.plugin.resource.ResourceProcessor | 533 | prepareResource in '' | 602 | doCall . . . . . . . . . . . in org.grails.plugin.resource.ResourceProcessor$_prepareSingleDeclaredResource_closure12
|     29 | addDeclaredResource           in org.grails.plugin.resource.util.ResourceMetaStore
|    600 | prepareSingleDeclaredResource in org.grails.plugin.resource.ResourceProcessor
|    625 | doCall                        in org.grails.plugin.resource.ResourceProcessor$_prepareResourceBatch_closure14 | 8 | each . . . . . . . . . . . . in org.grails.plugin.resource.ResourceProcessorBatch | 621 | prepareResourceBatch in org.grails.plugin.resource.ResourceProcessor | 804 | resourcesChanged . . . . . . in '' | 800 | loadModules in '' | 1056 | reloadAll . . . . . . . . . . in '' | 172 | doCall in ResourcesGrailsPlugin$_closure3
|    303 | innerRun . . . . . . . . . .  in java.util.concurrent.FutureTask$Sync | 138 | run in java.util.concurrent.FutureTask | 886 | runTask . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
|    908 | run                           in     ''
^    662 | run . . . . . . . . . . . . . in java.lang.Thread

Owner

What version of Grails/OS/JDK do you use? What is file encoding of your .less file?

Grails 2.0.1 on Windows 7 x64. JDK 1.6.0_24x64. File encoding of .less files is Western (ISO-8859-1). Thanks for your help!

I'm having the same problem, same error message. I'm on 1.6.0_25 x64 on Windows 7.

I'm running Grails 2.0.3.

I'm not doing anything custom, just using the stock bootstrap files and including the bootstrap module in my main.gsp layout. Still getting the unterminated string literal in bootstrap.less.

I have an identical issue. Im on the same environemnt as Iongwa above and have the same stacktrace.

This is actually a problem with the less-resources plugin and not the twitter plugin per se. It's a problem with handling the LESS compile path properly on Windows (and possibly Mac) machines. I submitted a patch for the less-resources plugin but haven't heard back.

The unterminated string literal is because a path string of C:\foo\bar is being passed to the LessCompiler and the \'s aren't escaped.

As a side note, you might be able to work around the problem for now by using the lesscss-resources plugin (instead of less-resources) as it seems to work on Windows at the moment and has been updated to 1.3.0 to support the latest bootstrap. This bootstrap plugin actually looks for either lesscss-resources OR less-resources so it will work for both.

Of course, both plugins have additional issues, the worst of which is that they don't seem to be able to compile LESS files that live in plugin directories. So, if you have a 'custom-bootstrap.less' as the doc suggests and try to import 'bootstrap.less' from the plugin directory, the compiler fails b/c it can't find bootstrap.less. I think both less plugins suffer this problem at the moement from what I can tell (at least on Grails 2.0.3)

longwa, is there a way to actually get this working until a new version of less-resources is available?

As you have pointed out, using lesscss-resources gets me no where as it won't handle the import in custom-bootstrap.less as the do suggests.

I spent a bit of time looking at the import issue and didn't see an easy fix. I saw a fork of the lesscss resource (Paul Fairless's) plugin from user jvalde that seemed to be working toward fixing both the compiling of LESS files within a plugin as well as using include "foo.less" syntax in your application LESS files where foo.less lives inside of a plugin.

Ideally, we have a main.less in our application which needs to import "bootstrap.less" from the plugin and this doesn't work right now in either one of the LESS plugins. I'm giving the jvalde fork a few days and if I don't see something I may try to address the issue myself.

I'm coming back to this issue myself, and it sounds like from your observations the easiest fix for now is to remove the twitter-bootstrap plugin and copy all the bootstrap less files into /web-app/less/ (or similar) and just rely on less-resources or lesscss-resources (the latter of which appears to be more actively maintained at this point) to compile it and expose it as a resource. It sounds like it should handle the import just fine if the files are in your app and outside the plugin directory, but perhaps I'm missing something?

Yeah, no problems using the plugin as long as you include all the needed bootstrap files in your application. That's what we are doing and it's working fine.

Thanks, but it still didn't quite work with less-resources. I removed the twitter bootstrap plugin, removed dependencies to it, and copied all the .less files to web-app/less - but I still got the same compile problem. I've switched to lesscss-resources and it seems to be working, though.

You're right, I'm also using the lesscss-resources plugin. I had tried both and forgot that I ended up going back to that one. I'm not sure the grails community really needs two LESS plugins. I'd settle for one that works properly.

Anyone have any update on this issue?

I am having the same issue on Grails 2.0.3 with twitter-bootstrap plugin 2.0.2.25 and less-resources 1.3.0.2. On startup of application it fails compilation of custom-bootstrap and then if I touch either ApplicationResources.groovy or custom-bootstrap.less files then the resources reload and they are fine. Not sure what is different about startup and subsequent resources reloads?

Can someone please articulate the value of using the twitter-bootstrap plugin given current broken state of integration with lesscss-resources?

I spent a couple days banging my head against these problems, not being able to import LESS files from within the plugin (to selectively override specific parts of bootstrap, e.g. from variables.less).

I understand the issue may lie with lesscss-resources plugin, but I've got to be able to compile the LESS -> CSS, and to bundle the resources properly, and it seems that in the current state (grails 2.0.0 + twitter-bootstrap 2.1.1 + lesscss-resources 1.3.0.3) the basic functionality that's intended, just doesn't work.

So now I plan to simply manage the bootstrap assets manually, bringing them into e.g. web-app/less/lib/bootstrap2.1.1/ or similar, then creating my own LESS files that leverage bootstrap as needed.

If someone has a better idea -- or a working solution that leverages both plugins with LESS -- I'd be very grateful.
Thanks!

Collaborator

Sorry to hear that it's not working properly for you. I have just taken over, so I have to investigate a bit first. Can you maybe provide an example project?

Have you confirmed that this problem is specific to the twitter bootstrap plugin? It might be a general issue with overriding files from plugins.

@liftyourgame - yes, it "works", as long as you don't try to customize it or reference its assets using LESS import. The lesscss-resources plugin currently (1.3.0.3) cannot find LESS assets provided by another plugin (such as twitter-bootstrap v2.1.1). This is a known issue in the lesscss-resources plugin:
paulfairless/grails-lesscss-resources#35

So if you create a foo.less file with an @import statement referencing bootstrap's .less files, lesscss-resources cannot find those files. So the documented bootstrap customization mechanism simply doesn't work.

@longwa and others above ran into precisely the same problem.

@nwittstruck - does this explanation make sense? The problem lies with lesscss-resources, not twitter-bootstrap, but in either case the documented mechanism for overriding parts of bootstrap-provided assets does not work. So the documentation here should be updated to reflect that. Perhaps the solution is to copy all the bootstrap plugin's .less files into web-app and never try to reference them from the plugin itself. Or maybe there's a way to make the plugin expose its assets inline in the web-app rather than leaving them in the plugin. Or maybe the lesscss-resources plugin can be fixed.

I'm eager for others' (working, proven) approaches to grails + lesscss-resources + bootstrap with LESS-based customizations.

Thanks!

As commented above, I got it working with lesscss-resources plugin and Bootstrap copied to my project (web-app/twitter-bootstrap). Still no problems.

@madeupname Thanks for replying. To be 100% clear, are you saying you are:
1. manually copying the twitter-bootstrap project's .less files into your web-app, and
2. using lesscss-resources to compile the less->css and to bundle the assets, and
3. not using the twitter-bootstrap grails plugin at all (at least not for the css).
Is that right?
If not, please clarify. Thanks much.

Yes, I came to the same conclusion and you and longwa that there's no other way to get this to work.

Collaborator

@cweekly We could change this plugin to make it work, e.g. by copying the bootstrap files to the app on installation. But I don't think this is an acceptable solution. In my opinion we should fix the lesscess-resources plugin, since this problem affects all other plugins, not only the twitter-bootstrap plugin.

If I remember correctly, the section in our readme about customizing the less variables used to work when used with the less-resources-plugin, also by Karol: http://www.grails.org/plugin/less-resources
But this functionality might be completely broken. I will add a notice to the readme until this issue has been fixed.

@nwittstruck I can't recall if the example of just overriding variables.less worked correctly in the less-resources plugin or not. I know they both suffered from the import issue, which is the bigger problem IMO. It may actually be possible to just drop a single file as an override (same as you can do with any other grails plugin files), as long as that file doesn't have any imports (which variables.less does not).

This is a serious issue! All people who use the bootstrap Plugin or any other less based plugin will face this problem one day when trying to modify the layout. This is not a general problem of THIS plugin but because of how the resource framework is constructed.

I recommend all users who like to import less files from another plugin like bootstrap, instead to copy the less files in your project and let THIS plugin compile them all together.

The less compiler needs to know the 'paths' where it will look for the imported less/css files. The less-resources plugin tries to build that path based on the order in which the less files are processed. So the following works:

1. Copy variables.less to your application (e.g. at web-apps/less/variables.less)
2. In ApplicationResources.groovy, define a dummy module at the beginning so that the less-resources plugin sets the less compiler path in correct order (/less in your application, and then /less in the twitter bootstrap plugin)
'dummy-module-to-set-paths' {
resource url: '/less/variables.less'
resource url: [plugin: 'twitter-bootstrap', dir: 'less', file: 'variables.less']
}
1. Define your app's module to depend on bootstrap
core {
dependsOn 'bootstrap'
}

The above approach gives you the ability to override bootstrap less files selectively. Any files in your apps /less directory will be used when bootstrap-less is compiled.

After struggling way too much to get this plugin working and bundling with my other resources properly, I give up. To be fair, I think the Resources plugin has some quirks which make setting things up a bit difficult. I've now copied the bootstrap less files into my project, uninstalled the twitter-bootstrap plugin, and am using lesscss-resources to compile everything. I'm hoping these issues can be resolved so I can track bootstrap upgrades by merely upgrading a plugin instead of managing the resources manually, but this is the path of least pain right now.

I recommend all users who like to import less files from another plugin like bootstrap, instead to copy the less files in your project and let THIS plugin compile them all together.

@lhanson what does your grails.resources.modules look like now?

modules = {
bootstrap {
defaultBundle 'core'
resource url: 'bootstrap/less/bootstrap.less'
}
core {
defaultBundle 'core'
dependsOn 'bootstrap'
resource url: 'less/main.less'
resource url: 'css/dummy.css' // Workaround so compiled LESS resources can be bundled
}
}


@lhanson thanks! Looks like the less in the latest version of bootstrap complicates things further by using features not available in the current compiler. Needs the grails less plugin to be updated.

Collaborator

The resources plugin needs to be updated as well. Marc Palmer has started a kickstarter project to fund the further development of the resources plugin.

using version 2.3.0 of the plugin lesscss-resources:1.3.1 gives a compile error too:

org.lesscss.LessException: Syntax Error on line 900
at org.lesscss.LessCompiler.compile(LessCompiler.java:283)
at org.lesscss.LessCompiler.compile(LessCompiler.java:335)
at org.lesscss.LessCompiler.compile(LessCompiler.java:359)
at org.lesscss.LessCompiler.compile(LessCompiler.java:325)
at org.lesscss.LessCompiler.compile(LessCompiler.java:312)
at LesscssResourceMapper.map(LesscssResourceMapper.groovy:35)
at org.grails.plugin.resource.mapper.ResourceMapper.invoke(ResourceMapper.groovy:139)
at org.grails.plugin.resource.mapper.ResourceMapper.invokeIfNotExcluded(ResourceMapper.groovy:128)
at org.grails.plugin.resource.ResourceProcessor.applyMappers(ResourceProcessor.groovy:593)
at org.grails.plugin.resource.ResourceProcessor.prepareResource(ResourceProcessor.groovy:539)
at org.grails.plugin.resource.ResourceProcessor$_prepareSingleDeclaredResource_closure12.doCall(ResourceProcessor.groovy:608) at org.grails.plugin.resource.util.ResourceMetaStore.addDeclaredResource(ResourceMetaStore.groovy:29) at org.grails.plugin.resource.ResourceProcessor.prepareSingleDeclaredResource(ResourceProcessor.groovy:606) at org.grails.plugin.resource.ResourceProcessor$_prepareResourceBatch_closure14.doCall(ResourceProcessor.groovy:631)
at org.grails.plugin.resource.ResourceProcessorBatch.each(ResourceProcessorBatch.groovy:8)
at org.grails.plugin.resource.ResourceProcessor.prepareResourceBatch(ResourceProcessor.groovy:627)
at org.grails.plugin.resource.ResourceProcessor.resourcesChanged(ResourceProcessor.groovy:810)
at ResourcesGrailsPlugin$_closure3.doCall(ResourcesGrailsPlugin.groovy:172) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
Caused by: org.mozilla.javascript.JavaScriptException: object Object
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1018)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
at org.lesscss.LessCompiler.compile(LessCompiler.java:270)
... 24 more
2013-03-09 15:45:16,085 ERROR [LesscssResourceMapper] - error compiling less file: /Users/l2c/.grails/2.2.0/projects/UbiCloud/tomcat/work/Tomcat/localhost/UbiCloud/grails-resources/plugins/twitter-bootstrap-2.3.0/less/bootstrap.less
org.lesscss.LessException: Syntax Error on line 891
at org.lesscss.LessCompiler.compile(LessCompiler.java:283)
at org.lesscss.LessCompiler.compile(LessCompiler.java:335)
at org.lesscss.LessCompiler.compile(LessCompiler.java:359)
at org.lesscss.LessCompiler.compile(LessCompiler.java:325)
at org.lesscss.LessCompiler.compile(LessCompiler.java:312)
at LesscssResourceMapper.map(LesscssResourceMapper.groovy:35)
at org.grails.plugin.resource.mapper.ResourceMapper.invoke(ResourceMapper.groovy:139)
at org.grails.plugin.resource.mapper.ResourceMapper.invokeIfNotExcluded(ResourceMapper.groovy:128)
at org.grails.plugin.resource.ResourceProcessor.applyMappers(ResourceProcessor.groovy:593)
at org.grails.plugin.resource.ResourceProcessor.prepareResource(ResourceProcessor.groovy:539)
at org.grails.plugin.resource.ResourceProcessor$_prepareSingleDeclaredResource_closure12.doCall(ResourceProcessor.groovy:608) at org.grails.plugin.resource.util.ResourceMetaStore.addDeclaredResource(ResourceMetaStore.groovy:29) at org.grails.plugin.resource.ResourceProcessor.prepareSingleDeclaredResource(ResourceProcessor.groovy:606) at org.grails.plugin.resource.ResourceProcessor$_prepareResourceBatch_closure14.doCall(ResourceProcessor.groovy:631)
at org.grails.plugin.resource.ResourceProcessorBatch.each(ResourceProcessorBatch.groovy:8)
at org.grails.plugin.resource.ResourceProcessor.prepareResourceBatch(ResourceProcessor.groovy:627)
at org.grails.plugin.resource.ResourceProcessor.resourcesChanged(ResourceProcessor.groovy:810)
at ResourcesGrailsPlugin$_closure3.doCall(ResourcesGrailsPlugin.groovy:172) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
Caused by: org.mozilla.javascript.JavaScriptException: object Object
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1018)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
at org.lesscss.LessCompiler.compile(LessCompiler.java:270)
... 24 more

I ended up using a variant of @sumitgogia's response to force bootstrap's less path onto the set of compile paths. Seems to work so far. The pertinent part of ApplicationResources.groovy looks like this:

'bootstrap-dummy' { resource url: [plugin: 'twitter-bootstrap', dir: 'less', file: 'bootstrap.less'], attrs:[rel: "stylesheet/less", type:'css'] }

'custom-bootstrap-less' {
dependsOn 'bootstrap'
resource url:'less/custom-bootstrap.less', attrs:[rel: "stylesheet/less", type:'css']
}

@matschaffer Which resources plugin are you using? less-resources or lesscss-resources?

• using lesscss-resources (1.3.3), your solution doesn't work (i.e. nothing happens)
• using less-resource (1.3.3.1), it doesn't compile.

Also, which twitter-bootstrap version are you using? I'm using 2.3.2

From my BuildConfig.groovy

compile ":less-resources:1.3.3.1"
compile ":twitter-bootstrap:2.3.0"

And the latest iteration of ApplicationResources.groovy (to support pulling in responsive css in the right order)

    'bootstrap-dummy' { resource url: [plugin: 'twitter-bootstrap', dir: 'less', file: 'bootstrap.less'], attrs:[rel: "stylesheet/less", type:'css'] }

'company-bootstrap-less' {
dependsOn 'bootstrap-js'
dependsOn 'bootstrap-responsive-less'
resource url:'less/company-bootstrap.less', attrs:[rel: "stylesheet/less", type:'css']
}

I've heard the wro4j grails plugin is decent if this is still giving your grief.

I have been trying to make this thing work, without any luck. :(
I also created a simple project so we all can contribute to make it work so people can use it for start.