marceloverdijk / lesscss-maven-plugin

LESS CSS Maven Plugin
170 stars 59 forks source link

Simple Css - ParseError: Unrecognised input #75

Open damogallagher opened 7 years ago

damogallagher commented 7 years ago

Hi

I am trying to use this plugin to namespace some css for me. I have the following file template2.less defined `.bootstrap-styles { @import (less) 'file.css'; }

The contents of file.css are as follows (stripped down for ease of reading) #ribbon .breadcrumb,#ribbon .breadcrumb a{color:#BBB!important;text-decoration:none!Important}#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#E4E4E4}

My pom entry for the plugin is as follows `

org.lesscss
            <artifactId>lesscss-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <sourceDirectory>${basedir}/src/main/resources/static/namespacedCss</sourceDirectory>
                <outputDirectory>${basedir}/src/main/resources/static/namespacedCss</outputDirectory>
                <compress>false</compress>
                <includes>
                    <include>template2.less</include>
                </includes>
                <force>true</force>
            </configuration>
        </plugin> `

The error I am getting is as follows

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building bootstrap 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- lesscss-maven-plugin:1.7.0.1.1:compile (default) @ bootstrap ---
[INFO] Compiling LESS source: template2.less...
[ERROR] C:\development\workspaces\eclipse\project\project-QA\bootstrap2\src\main\resources\static\namespacedCss\template2.less [0:0]: Error compiling LESS source
org.lesscss.LessException: ParseError: Unrecognised input in C:\Users\user\AppData\Local\Temp\tmp8057122016620349881less.tmp on line 2, column 3:
1 .bootstrap-styles {
2   #ribbon .breadcrumb,#ribbon .breadcrumb a{color:#BBB!important;text-decoration:none!Important}#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#E4E4E4}
3 }

    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:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    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:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.mozilla.javascript.JavaScriptException: Error: ParseError: Unrecognised input in C:\Users\user\AppData\Local\Temp\tmp8057122016620349881less.tmp on line 2, column 3:
1 .bootstrap-styles {
2   #ribbon .breadcrumb,#ribbon .breadcrumb a{color:#BBB!important;text-decoration:none!Important}#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#E4E4E4}
3 }
 (jar:file:/C:/Users/user/.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__C__Users_user__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:/C:/Users/user/.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__C__Users_user__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:/C:/Users/user/.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__C__Users_user__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:/C:/Users/user/.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__C__Users_user__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:/C:/Users/user/.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__C__Users_user__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:/C:/Users/user/.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__C__Users_user__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:/C:/Users/user/.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__C__Users_user__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:/C:/Users/user/.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)
    ... 28 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.791 s
[INFO] Finished at: 2017-05-19T10:49:36+01:00
[INFO] Final Memory: 13M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.lesscss:lesscss-maven-plugin:1.7.0.1.1:compile (default) on project bootstrap: Error while compiling LESS source: template2.less: ParseError: Unrecognised input in C:\Users\user\AppData\Local\Temp\tmp8057122016620349881less.tmp on line 2, column 3:
[ERROR] 1 .bootstrap-styles {
[ERROR] 2   #ribbon .breadcrumb,#ribbon .breadcrumb a{color:#BBB!important;text-decoration:none!Important}#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#E4E4E4}
[ERROR] 3 }: Error: ParseError: Unrecognised input in C:\Users\user\AppData\Local\Temp\tmp8057122016620349881less.tmp on line 2, column 3:
[ERROR] 1 .bootstrap-styles {
[ERROR] 2   #ribbon .breadcrumb,#ribbon .breadcrumb a{color:#BBB!important;text-decoration:none!Important}#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#E4E4E4}
[ERROR] 3 }
[ERROR] (jar:file:/C:/Users/user/.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)
[ERROR] -> [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

`

Any idea what I can do to resolve this?

Thank you Damien `

damogallagher commented 7 years ago

Updated css to be #ribbon .breadcrumb,#ribbon .breadcrumb a{color:#BBB!important;text-decoration:none!Important;}#ribbon .breadcrumb li:last-child,#ribbon .breadcrumb>.active{color:#E4E4E4} and it compiled successfully