marceloverdijk / lesscss-maven-plugin Goto Github PK
View Code? Open in Web Editor NEWLESS CSS Maven Plugin
LESS CSS Maven Plugin
I keep getting the following error when I use @import-once in place of @import:
[INFO] --- lesscss-maven-plugin:1.3.3:compile (default-cli) @ test-project ---
[INFO] Compiling LESS source: base.less...
[ERROR] /Users/virmani/workspace/server/src/main/resources/less/base.less [0:0]: Error compiling LESS source
org.lesscss.LessException: Couldn't load undefineddev.less (0)
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.mojo.CompileMojo.execute(CompileMojo.java:131)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
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
Hi
I followed the usage part of the Readme.md :
org.lesscss lesscss-maven-plugin 1.3.0 compileI have this error in my eclipse IDE :
Plugin execution not covered by lifecycle configuration: org.lesscss:lesscss-maven-plugin:1.3.0:compile (execution: default, phase: process-sources)
However, the complier still work.
Is there a way to make this error disappear or should i just ignore the warning ?
Thx for providing less compilation with maven !
I have been given a .css file example that is totally minfiied to 1 line. I built w/ compress=true but it is still on many lines. Is this the correct/documented behavior or am I having issues as usual?
As promised I'm now working on syncing my fork (de.sandroboehme.lesscss:lesscss-maven-plugin:1.6.1.1.0 from https://github.com/sandroboehme/lesscss-maven-plugin) back to this project.
The next version will be org.lesscss:lesscss-maven-plugin:1.7.0.1.0
as it is the 1.0 release for less 1.7.0 (Rhino based).
The currently pushed code fixes the following issues:
org.lesscss:lesscss:1.7.0.1.0
README.md
update, and file prefix feature of #49.You can now test the plugin by running the automatic tests and by installing and trying it. Please let me know if everything works fine or if there are problems that prevent a release. I will not start a release in the next week to provide time for testing.
Best,
Sandro
The configuration for maven-compiler-plugin contains
<encoding>UTF-8</encoding>
which is not needed cause the default for maven-compiler-plugin encoding usses the property
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
which means simply if you have defined the property you con't need to give explicit configuration for encoding.
A less file which has a whitespace character before an import causes the compiler to fail
// Include dependencies
@import "some-file.less";
//
Throws the error Couldn't load undefinedsome-file.less
Hi. It looks like nobody has free time for this project. The current snapshot is broken after several merged pull requests. Plase talk to the project owner (Marcel) if you want to become a comitter. Thank you
I don´t know if this issue belongs here or to the lesscss-java
I've set the force configuration to true, but unmodified files are ignored.
This is a fragment of mvn -X lesscss:compile
output:
[DEBUG] Configuring mojo 'org.lesscss:lesscss-maven-plugin:1.3.0:compile' with basic configurator -->
[DEBUG] (f) compress = true
[DEBUG] (f) force = true
[DEBUG] (f) includes = [billing.less, searchfield.less, singup.less]
[DEBUG] (f) outputDirectory = /Users/diegof/Projects/console-web/src/main/webapp/static/stylesheets
[DEBUG] (f) sourceDirectory = /Users/diegof/Projects/console-web/src/main/less
[DEBUG] -- end configuration --
[DEBUG] sourceDirectory = /Users/diegof/Projects/console-web/src/main/less
[DEBUG] outputDirectory = /Users/diegof/Projects/console-web/src/main/webapp/static/stylesheets
[DEBUG] includes = [billing.less, searchfield.less, singup.less]
[DEBUG] excludes = []
[DEBUG] force = true
[DEBUG] lessJs = null
[DEBUG] included files = [billing.less, searchfield.less, singup.less]
[INFO] Bypassing LESS source: billing.less (not modified)
[INFO] Bypassing LESS source: searchfield.less (not modified)
[INFO] Bypassing LESS source: singup.less (not modified)
[INFO] Compilation finished in 567 ms
In the output you can see the "Bypassing" message even when force = true
Hi Marcel,
Thanks for work.
Using the plugin I have found something which could be great to add to your plugin, replacing in html files the less stylesheets by the new css ones generated.
Maybe other people have the same need ?
What do you think about it ?
Regards,
Maxime
I don't know if it's possible already. But I'd like to see an option to remove all comments except the ones that have an exclamation mark (!).
Example from YUI:
/*! this stays after compile */
.content p {
margin: 0 0 12px 0;
}
/* this gets removed, because no "!" */
.someclass div {
display: inline;
}
The reason I ask is because I like to auto-generate a styleguide but I don't want the style-guide comments (which are huge!) in the compiled css. I do want 'some' standard comments in the compiled source.
Is this already possible? If not, is it hard to implement?
In normal less.js it is possible to import normal css files
But when maven plugin is used , directive @import 'myfile.css';* is ignored and is written into output css file
Is it possible to configure different source directories and to send this different sources to different output folder?
Hi!
In some projects, bootstrap-js for example, the developers are not using imports but instead they pastes all .less-files into one big file and then compile that to css. Is that possible to do with the lesscss-maven-plugin in it's current state? Is there a plan to handle that?
Best regards
Roland
When a less file/folders do not exist there should be an option to allow the plugin to continue instead of failing and wiping out the build.
Compiling LESS source: viewer_dark.less...
/home/***/src/main/java/../webapp/less/main/viewer_dark.less [0:0]: Error compiling LESS source
org.lesscss.LessException: RuntimeError: error evaluating function `data-uri`: Cannot convert org.mozilla.javascript.NativeArray@103af23c to byte[] (jar:file:/home/***/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js#145) in /tmp/tmp6500585619073531749less.tmp on line 382, column 44:
381
382 .pv-clear-all,.pv-cat-clear{background:data-uri("@{embedImgBase}/clear.png") no-repeat 50% 50%;}
383 .pv-clear-all{width:60px; margin:0 0 4px 0; padding:0 5px; line-height:24px; float:right; color:@color-control-text-dark2; background-position:54px 50% ;visibility:hidden;}
at org.lesscss.LessCompiler.compile(LessCompiler.java:423)
at org.lesscss.LessCompiler.compile(LessCompiler.java:330)
at org.lesscss.LessCompiler.compile(LessCompiler.java:474)
at org.lesscss.LessCompiler.compile(LessCompiler.java:498)
at org.lesscss.mojo.CompileMojo.compileIfChanged(CompileMojo.java:187)
at org.lesscss.mojo.CompileMojo.executeInternal(CompileMojo.java:157)
at org.lesscss.mojo.CompileMojo.execute(CompileMojo.java:122)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.mozilla.javascript.JavaScriptException: Error: RuntimeError: error evaluating function `data-uri`: Cannot convert org.mozilla.javascript.NativeArray@103af23c to byte[] (jar:file:/home/***/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js#145) in /tmp/tmp6500585619073531749less.tmp on line 382, column 44:
381
382 .pv-clear-all,.pv-cat-clear{background:data-uri("@{embedImgBase}/clear.png") no-repeat 50% 50%;}
383 .pv-clear-all{width:60px; margin:0 0 4px 0; padding:0 5px; line-height:24px; float:right; color:@color-control-text-dark2; background-position:54px 50% ;visibility:hidden;}
(jar:file:/home/accelerate/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js#9361)
at org.mozilla.javascript.gen.jar_file__home_accelerate__m2_repository_org_lesscss_lesscss_1_7_0_1_1_lesscss_1_7_0_1_1_jar__META_INF_less_rhino_1_7_0_js_1._c_writeError_660(jar:file:/home/accelerate/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js:9361)
at org.mozilla.javascript.gen.jar_file__home_accelerate__m2_repository_org_lesscss_lesscss_1_7_0_1_1_lesscss_1_7_0_1_1_jar__META_INF_less_rhino_1_7_0_js_1.call(jar:file:/home/accelerate/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js)
at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
at org.mozilla.javascript.gen.jar_file__home_accelerate__m2_repository_org_lesscss_lesscss_1_7_0_1_1_lesscss_1_7_0_1_1_jar__META_INF_less_rhino_1_7_0_js_1._c_anonymous_665(jar:file:/home/accelerate/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js:9746)
at org.mozilla.javascript.gen.jar_file__home_accelerate__m2_repository_org_lesscss_lesscss_1_7_0_1_1_lesscss_1_7_0_1_1_jar__META_INF_less_rhino_1_7_0_js_1.call(jar:file:/home/accelerate/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js)
at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
at org.mozilla.javascript.gen.jar_file__home_accelerate__m2_repository_org_lesscss_lesscss_1_7_0_1_1_lesscss_1_7_0_1_1_jar__META_INF_less_rhino_1_7_0_js_1._c_script_0(jar:file:/home/accelerate/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js:9448)
at org.mozilla.javascript.gen.jar_file__home_accelerate__m2_repository_org_lesscss_lesscss_1_7_0_1_1_lesscss_1_7_0_1_1_jar__META_INF_less_rhino_1_7_0_js_1.call(jar:file:/home/accelerate/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at org.mozilla.javascript.gen.jar_file__home_accelerate__m2_repository_org_lesscss_lesscss_1_7_0_1_1_lesscss_1_7_0_1_1_jar__META_INF_less_rhino_1_7_0_js_1.call(jar:file:/home/accelerate/.m2/repository/org/lesscss/lesscss/1.7.0.1.1/lesscss-1.7.0.1.1.jar!/META-INF/less-rhino-1.7.0.js)
at org.lesscss.LessCompiler.compile(LessCompiler.java:383)
... 27 more
------------------------------------------------------------------------
BUILD FAILURE
Can css file be output to the same directory with less?
Currently, if the source directory doesn't exist, the build fails. It would be better to skip the plugin execution and let the build proceed in such case (as many other plugins do).
Also, due to the current behaviour (failing the build) it's not possible to configure the plugin in a parent POM in <build><plugins>
section (unless you create empty source directory).
Hello,
I've tried to use your (wonderfull) plugin from within Eclipse (with m2e), but nothing happens : no css file is generated.
Could you provide a kind of how-to for using this plugin in Eclipse ?
Thanks a lot.
It would be very useful in complex projects (and in my own, of course :) ) to be able to skip the execution of the lesscss-maven-plugin if a property is set to true.
Just as in derby-maven-plugin and in the testing family of plugins (surefire, junit, you know...)
....
<configuration>
....
<skip>${myProperty}</skip> <!-- <skip>true</skip> or <skip>false</skip> -->
...
</configuration>
I guess that copying from those plugins that already have a skip mechanism would even be a breeze!
I'd submit a pull-request myself if I was a better Java developer!
Is this plugin thread safe? Can it be marked as such?
[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project *
[WARNING] * contains the following plugin(s) that have goals not marked *
[WARNING] * as @threadsafe to support parallel building. *
[WARNING] * While this /may/ work fine, please look for plugin updates *
[WARNING] * and/or request plugins be made thread-safe. *
[WARNING] * If reporting an issue, report it against the plugin in *
[WARNING] * question, not against maven-core *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked @threadsafe in Test:
[WARNING] org.apache.maven.plugins:maven-dependency-plugin:2.3
[WARNING] org.lesscss:lesscss-maven-plugin:1.3.3
[WARNING] org.codehaus.gmaven:gmaven-plugin:1.4
I'm compiling a LESS overlay for Bootstrap that just needs to refer to a few of the variables, like the grid size. I'm using Webjars to grab the Bootstrap source for the build, but currently I have to copy my own LESS source into a secondary directory, unpack Bootstrap there, and tell lesscss-maven-plugin to compile that into the final output directory. It would be helpful to be able to specify multiple source directories to be able to skip the copy.
Using &:extend prevents compilation.
I'm using a third-party less file under the condition that the author needs to be credited in human readable form in the CSS file. Putting those details in a comment (// style or /* style) causes them to be stripped when compress=true. Is there a way to force a comment to be put in the output file when compress=true?
A new release is available now at Maven Central.
It's the 1.0 release of the plugin for Less 1.6.1.
It contains the pull request of
#12
#36
#25
#17
#16
#7
It is based on a fork of org.lesscss:lesscss that has been updated to Less 1.6.1. The fork is de.sandroboehme.lesscss:lesscss:1.6.1.1.0 and can be found here https://github.com/sandroboehme/lesscss-java
As I don't have commit rights here (details here: marceloverdijk/lesscss-java#41 (comment)) I had to release my fork of the lesscss-maven-plugin
. It is de.sandroboehme.lesscss:lesscss-maven-plugin:1.6.1.1.0
from https://github.com/sandroboehme/lesscss-java.
I don't intend to surpass org.lesscss I just need a released version of this plugin for Less 1.6.x to allow my users to have an out of the box compilation of my Less sources for my Bootstrap 3 project. I'm happy to repackage my plugin back to org.lesscss if someone is willing to pull and release it.
Add 'filtering' configuration option to allow use ${..} variables in .less files, or something similar that maven resources pug in does:
http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html
[INFO] Compiling LESS source: accordion.less...
[ERROR] C:\myPrgosUI\ResponsiveTest\src\main\less\accordion.less [0:0]: Error compiling LESS source
org.lesscss.LessException: variable @baseLineHeight is undefined
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.mojo.CompileMojo.execute(CompileMojo.java:131)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
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
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.266s
[INFO] Finished at: Sun Jun 16 16:41:15 IST 2013
[INFO] Final Memory: 9M/45M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.lesscss:lesscss-maven-plugin:1.3.3:compile (default) on project ResponsiveTest: Error while compiling LESS source: accordion.less: variable @baseLineHeight is undefined: object Object -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Hello,
The plugin is not compliant with last less css version (1.5.0). Here is the output when I try to compile my sources and set lesscss file 1.5.0 in the configuration with
src/main/resources/less/less.min.js:
[ERROR] C:\um\workspace\commons\ui\css\src\main\resources\style\base.less [0:0]: Error compiling LESS source
org.lesscss.LessException: Impossible de trouver la fonction split dans lobjet {1}.
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.mojo.CompileMojo.execute(CompileMojo.java:131)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
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
Is there a possible workaround. When do you plan to be compliant with last version of lesscss ?
Regards,
Christophe Pérot ( Axway )
The property
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
is not necessary to set explicit cause its set already in the parent which is inherited.
I use the plugin in my Java EE web app (thank you for that!) but it fails if the LESS file (which should be compiled) uses @import declarations.
For example:
@import url("http://fonts.googleapis.com/css?family=Open+Sans:600,700,400");
The error message is:
Error compiling LESS source
java.io.FileNotFoundException: File Q:\dev\projects\wlc\wlc-webapp\src\main\webapp\WEB-INF\frontend\less\http:\fonts.googleapis.com\css?family=Open+Sans:600,700,400.less not found.
Actual Input in .less file
body, html {
/* IE<10 Scrollbars */
scrollbar-3dlight-color:;
scrollbar-arrow-color:;
scrollbar-base-color:;
scrollbar-darkshadow-color:;
scrollbar-face-color:;
scrollbar-highlight-color:;
scrollbar-shadow-color:;
/* IE10+ Scrollbars */
-ms-scrollbar-3dlight-color:;
scrollbar-arrow-color:;
-ms-scrollbar-base-color:;
-ms-scrollbar-darkshadow-color:;
-ms-scrollbar-face-color:;
-ms-scrollbar-highlight-color:;
-ms-scrollbar-shadow-color:;
}
after converting result of Css File
body,
html {
/* IE<10 Scrollbars */
scrollbar-3dlight-color: ;
scrollbar-base-color: ;
scrollbar-darkshadow-color: ;
scrollbar-face-color: ;
scrollbar-highlight-color: ;
scrollbar-shadow-color: ;
/* IE10+ Scrollbars */
-ms-scrollbar-3dlight-color: ;
scrollbar-arrow-color: ;
-ms-scrollbar-base-color: ;
-ms-scrollbar-darkshadow-color: ;
-ms-scrollbar-face-color: ;
-ms-scrollbar-highlight-color: ;
-ms-scrollbar-shadow-color: ;
}
As from the example you can see I have created properties for different different browsers for body,html tags and after conversion the " scrollbar-arrow-color:;" is getting deleted from "/* IE<10 Scrollbars / " and present in "/ IE10+ Scrollbars */"
Could please let me know if there any changes can be made to pom.xml.
Would it be possible to add support for generating source maps to make debugging easier?
I'm having problem for compiling less files when I set my 'current language for non-Unicode programs' setting as Korean, Japanese or Chinese(I guess there should be more languages which occurs this problem). I got error message like this.
[INFO] Compiling LESS source: develop\develop.less...
[ERROR] c:*******\develop.less [0:0]: Error compiling LESS source
org.lesscss.LessException: org.mozilla.javascript.EcmaError: TypeError: Cannot c
all method "toCSS" of undefined (doIt.js#1)
at org.lesscss.LessCompiler.compile(LessCompiler.java:286)
at org.lesscss.LessCompiler.compile(LessCompiler.java:335)
at org.lesscss.LessCompiler.compile(LessCompiler.java:359)
at org.lesscss.mojo.CompileMojo.execute(CompileMojo.java:131)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "toCS
S" of undefined (doIt.js#1)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.jav
a:3687)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.jav
a:3665)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:369
3)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:37
12)
at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.jav
a:3731)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(Scr
iptRuntime.java:2258)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRun
time.java:2251)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:131
7)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.j
ava:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:3
94)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:309
1)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.j
ava:107)
at org.lesscss.LessCompiler.compile(LessCompiler.java:270)
... 24 more
This message probably comes from the less compiler itself as I couldn't see it in CompileMojo.compileIfChanged()
[INFO] --- lesscss-maven-plugin:1.7.0.1.0:compile (default) @ myproject---
[INFO] Compiling LESS source: resources\style.less...
done
[INFO] Finished compilation to c:\projects\myproject\target\webapp in 593 ms
[INFO] Complete Less compile job finished in 609 ms
BTW, less is sometimes spelled LESS or Less...
Our team currently has developers that use both Mac and Windows as their main platform. We use IntelliJ IDEA so that we can have a consistent coding experience between the 2 platforms. We are currently having an issue where the generated CSS files are being created differently depending on what platform is being used.
This is the code that we are using:
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<version>1.7.0.1.1</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/plugin/resources/script/apps</sourceDirectory>
<outputDirectory>${project.basedir}/src/main/plugin/resources/script/apps</outputDirectory>
<outputFileFormat>{fileName}.min.css</outputFileFormat>
<compress>true</compress>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
When we run mvn clean package on a Mac the CSS files are generated in the same folder as the original LESS file was located.
EXAMPLE
Source - ${project.basedir}/src/main/plugin/resources/script/apps/missions/missions.less
Output - ${project.basedir}/src/main/plugin/resources/script/apps/missions/missions.css
When we run mvn clean package on a Windows machine the CSS files are generated in the outputDirectory with the folder structure appearing as the first part of the filename itself.
EXAMPLE
Source - ${project.basedir}/src/main/plugin/resources/script/apps/missions/missions.less
Output - ${project.basedir}/src/main/plugin/resources/script/apps/missionsmissions.css
Is there a reason that there would be a difference between the way the Mac and the Windows machines are generating the CSS files?
Maybe this is the way it's supposed to be, but I can't find anything about it on the less homepage.
If I write @import 'dir/test'; it will look for ${project.basedir}/dir/test.less, but if I instead write @import "dir/test"; it will look for the file from the current directory.
Is this a feature or bug?
/Rasmus
I'm not sure but this might be a less bug but, It seems that if I use less-rhino-1.7.0.js as lessJs property (downloaded from https://raw.githubusercontent.com/less/less.js/v1.7.0/dist/less-rhino-1.7.0.js)
I am unable to get less to compile with any include option. Perhaps this is a limitation of rhino?
Surely it should be possible for the plugin to work from the base of a website, look for all .less files and then compile the css files alongside the .less files. There is a plugin already that does something similar at https://github.com/achingbrain/less-maven-plugin, but it hasn't been edited in a year and isn't as good as this plugin.
Please help
Consider below plugin definition example. Here, the source directory is not read and it defaults to src/main/less used by the plugin. So, none of the configurations specified in the executions tag are being applied.
org.lesscss lesscss-maven-plugin 1.3.3<executions>
<execution>
<id>MinifiedExecution</id>
<configuration> <sourceDirectory>${project.basedir}/src/main/resources/styles</sourceDirectory>
<outputDirectory>${project.basedir}/target/minified/</outputDirectory>
<compress>true</compress>
<includes>
<include>**/udit.less</include>
</includes>
</configuration>
</execution>
</executions>
Migrate Mojo definition to Java 5 Annotation based configuration.
Hi:
When I use lesscss-maven-plugin and I package the application works fine, the final CSS is pakaged in war but, when I develop the application with maven-jetty-plugin the files are't included in workspace (only in target), in that directory jetty works but doesn't exist the compiled less file.
My configuration is:
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/webapp/less</sourceDirectory>
<outputDirectory>${project.build.directory}/${project.build.finalName}/css</outputDirectory>
<compress>true</compress>
<includes>
<include>main.less</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
Exist an any other configuracion to make this works? maybe in another goal (jetty:run) copy compiled css in other path? is that posible? (and then deleted)
any ideas?
Not sure if this is a plugin issue or a lesscss issue. I'm trying to do the following
@import (reference) "http://yui.yahooapis.com/pure/0.3.0/buttons-min.css";
and then apply that style to all my buttons
button {
.pure-button
}
I get
[ERROR] 234 }: Error: NameError: .pure-button is undefined in /var/folders/l_/8yr1sgwd1bqgttcb1dhq_zsr0000gp/T/tmp8671075994062153763less.tmp on line 233, column 3:
[ERROR] 232 button {
[ERROR] 233 .pure-button
[ERROR] 234 }
Is this a bug or my misunderstanding? And if my misunderstanding, is there a way to accomplish what I'm trying to do.
We've recently started using Less in our project and it compiles for less than a second with the node-less package under Ubuntu. I tried to add it to the maven build, so we can remove the file from the Git repo, because it blows-up the patches.
I waited 10 minutes for it to compile with this plugin before I stopped it.
This is our plugin configuration.
<plugin>
<groupId>org.lesscss</groupId>
<artifactId>lesscss-maven-plugin</artifactId>
<version>1.7.0.1.1</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/webapp/less</sourceDirectory>
<outputDirectory>${project.build.directory}/${project.build.finalName}/css</outputDirectory>
<includes>
<include>style.less</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
These are our Less scripts https://www.dropbox.com/s/i06njcgy184t4hz/less.tar.gz?dl=0
Also, these are the maven compile logs with -X when I was done waiting and stopped it:
[INFO]
[INFO] --- lesscss-maven-plugin:1.7.0.1.1:compile (default) @ webapp ---
[DEBUG] org.lesscss:lesscss-maven-plugin:jar:1.7.0.1.1:
[DEBUG] commons-logging:commons-logging:jar:1.1.1:compile
[DEBUG] commons-io:commons-io:jar:2.4:compile
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:3.0:compile
[DEBUG] org.lesscss:lesscss:jar:1.7.0.1.1:compile
[DEBUG] org.mozilla:rhino:jar:1.7R4:compile
[DEBUG] org.slf4j:slf4j-simple:jar:1.7.2:runtime
[DEBUG] org.slf4j:slf4j-api:jar:1.7.2:runtime
[DEBUG] org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile
[DEBUG] Created new class realm plugin>org.lesscss:lesscss-maven-plugin:1.7.0.1.1
[DEBUG] Importing foreign packages into class realm plugin>org.lesscss:lesscss-maven-plugin:1.7.0.1.1
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.lesscss:lesscss-maven-plugin:1.7.0.1.1
[DEBUG] Included: org.lesscss:lesscss-maven-plugin:jar:1.7.0.1.1
[DEBUG] Included: commons-logging:commons-logging:jar:1.1.1
[DEBUG] Included: commons-io:commons-io:jar:2.4
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0
[DEBUG] Included: org.lesscss:lesscss:jar:1.7.0.1.1
[DEBUG] Included: org.mozilla:rhino:jar:1.7R4
[DEBUG] Included: org.slf4j:slf4j-simple:jar:1.7.2
[DEBUG] Included: org.slf4j:slf4j-api:jar:1.7.2
[DEBUG] Included: org.sonatype.plexus:plexus-build-api:jar:0.0.7
[DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:2.0
[DEBUG] Configuring mojo org.lesscss:lesscss-maven-plugin:1.7.0.1.1:compile from plugin realm ClassRealm[plugin>org.lesscss:lesscss-maven-plugin:1.7.0.1.1, parent: sun.misc.Launcher$AppClassLoader@7694837a]
[DEBUG] Configuring mojo 'org.lesscss:lesscss-maven-plugin:1.7.0.1.1:compile' with basic configurator -->
[DEBUG] (f) compress = false
[DEBUG] (f) encoding = UTF-8
[DEBUG] (f) force = false
[DEBUG] (f) includes = [style.less]
[DEBUG] (f) outputDirectory = /home/ME/workspace/PROJECT/target/ROOT/css
[DEBUG] (f) skip = false
[DEBUG] (f) sourceDirectory = /home/ME/workspace/PROJECT/src/main/webapp/less
[DEBUG] (f) watch = false
[DEBUG] (f) watchInterval = 1000
[DEBUG] -- end configuration --
[DEBUG] sourceDirectory = /home/ME/workspace/PROJECT/src/main/webapp/less
[DEBUG] outputDirectory = /home/ME/workspace/PROJECT/target/ROOT/css
[DEBUG] includes = [style.less]
[DEBUG] excludes = []
[DEBUG] force = false
[DEBUG] lessJs = null
[DEBUG] skip = false
[DEBUG] included files = [style.less]
[INFO] Compiling LESS source: style.less...
^C
Hi,
I typically build our project with the Maven option "-T 1.5C"; this reduces the build time (on my hardware) significantly. However, since we added the lesscss-maven-plugin to our build, I get a warning:
[WARNING] *****************************************************************
[WARNING] * Your build is requesting parallel execution, but project *
[WARNING] * contains the following plugin(s) that are not marked as *
[WARNING] * @threadSafe to support parallel building. *
[WARNING] * While this /may/ work fine, please look for plugin updates *
[WARNING] * and/or request plugins be made thread-safe. *
[WARNING] * If reporting an issue, report it against the plugin in *
[WARNING] * question, not against maven-core *
[WARNING] *****************************************************************
[WARNING] The following plugins are not marked @threadSafe in cae-base-webapp:
[WARNING] org.lesscss:lesscss-maven-plugin:1.3.3
[WARNING] *****************************************************************
According to https://github.com/marceloverdijk/lesscss-java, lesscss-java itself is thread-safe. So is there any inherent reason why you cannot mark lesscss-maven-plugin as @threadSafe
? Or can you please do so?
Thanks!
Regards,
Christoph
If the directory is sourceDirectory empty, the outputDirectory is not created. Can I add a parameter or always create directory outputDirectory?
To move to lesscss-java 1.7.0.1.1 I released the new version 1.7.0.1.1 of this plugin.
See marceloverdijk/lesscss-java#53 for background information.
I can't wait to use the new 1.4 features such as the data-uri function. Hope you can bump up the version to 1.4.1 any time soon. Many thanks for the great work so far!
I have been very happy with the use of node and Grunt to compile LESS. It just works and it is extremely fast.
How about allowing this plugin to delegate to node? Instead of using the lesscss-java project?
(thanks for the great plugin! small issue below:)
@media screen { @import "homepage.less"; @import "searchresults.less"; }
-> fails
@media screen { @import "homepage.less"; @import "searchresults.less"; }
-> does not fail.
Whitespace before imports seem to break compilation
/*@import "homepage.less";*/
also breaks. blocklevel comments and imports don't get along either.
[ERROR] Failed to execute goal org.lesscss:lesscss-maven-plugin:1.7.0.1.0:compile (default) on project test: Error while compiling LESS source: css/test.less: FileError: 'test.less' wasn't found in /var/folders/gr/vx891bvn2g7ds11njbzlnqf80000gn/T/tmp8429192458404082989less.tmp on line 1931, column 1:
...
@import (reference) works just fine when using the javascript version of LESS on my pages, but when trying to build through lesscss-maven-plugin
I get file not found errors. Is this intended to work, or is this unsupported by the plugin?
Thank your for your awesome plugin, it works perfectly, except the corresponding issue:
The directory structure to illustrate the bug is following:
| - themeA/
| | - images/
| | | - background.png
| | - theme.less
| - config.less
| - application.less
In themes.less, it configuration the less variables used by application.less, for example:
@image-url: "images";
@background-image: url("@{image-url}/background.png");
In the config.less, it declare which theme should be used:
@import "themeA/theme.less";
In the application.less, it only dependence on the config.less so it can use the theme related variables:
@import "config.less";
.demoDiv: {
background: @background-image;
}
The above example works fine in the client side by including less.js, which will interpret the background image url as:
http://mydomain/css/themeA/images/background.png
While switching to use maven lesscss plugin to generate css in compile time, it interpret the background image url wrongly as:
http://mydomain/css/images/background.png
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.