GeoDienstenCentrum / sass-maven-plugin

Maven Plugin to Compile SASS files into CSS
https://www.geodienstencentrum.nl/sass-maven-plugin/
Apache License 2.0
55 stars 18 forks source link

Feature Request: Get plugin working with cygwin #98

Closed TheProgenitus closed 8 years ago

TheProgenitus commented 8 years ago

I can't use the plug with build using cygwin (bash) as my shell in windows 7. The reason is that the plugin tries to a access the files with absolute paths (starting with C:/... ). It is possible to get it working using relativ paths?

Here is an output with an error regarding this issue: XXX@verne /cygdrive/c/Users/XXX/Documents/YYY/projects/ZZZ/content $ mvn sass:update-stylesheets [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building ZZZ CRX Package 1.15.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- sass-maven-plugin:2.9-RC1:update-stylesheets (default-cli) @ ZZZ-content --- [INFO] Compiling Sass Templates [INFO] Queueing Sass template for compile: C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/scss => C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/css [INFO] Queueing Sass template for compile: C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/scss => C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/css [ERROR] Compilation of template C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/scss/main.scss failed: Invalid Windows-1252 character "\xC3" [INFO] >> C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/scss/ink.scss => C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/css/ink.css [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 21.143 s [INFO] Finished at: 2016-02-17T16:47:47+01:00 [INFO] Final Memory: 87M/826M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal nl.geodienstencentrum.maven:sass-maven-plugin:2.9-RC1:update-stylesheets (default-cli) on project ZZZ: Sass compilation encountered errors (see above for details). -> [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/MojoFailureException

mprins commented 8 years ago

Ultimately the path is constructed by maven using the sassSourceDirectory parameter which defaults to ${basedir}/src/main/sass but can take a relative path

When you look at the error message it actually says you are using an invalid character in main.scss

TheProgenitus commented 8 years ago

The configuration is:

<plugin>
    <groupId>nl.geodienstencentrum.maven</groupId>
    <artifactId>sass-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>process-source</phase>
            <goals>
                <goal>update-stylesheets</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <sassOptions>
            <sourcemap>:none</sourcemap>
            <style>:compressed</style>
            <always_update>:true</always_update>
        </sassOptions>
        <useCompass>false</useCompass>
        <compassConfigFile>src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/config.rb</compassConfigFile>
        <resources>
            <resource>
                <source>
                    <directory>${basedir}/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/scss</directory>
                    <includes>
                        <include>main.scss</include>
                    </includes>
                    <excludes/>
                </source>
                <destination>${basedir}/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/css</destination>
            </resource>
            <resource>
                <source>
                    <directory>${basedir}/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/scss</directory>
                    <includes>
                        <include>ink.scss</include>
                    </includes>
                    <excludes/>
                </source>
                <destination>${basedir}/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/css</destination>
            </resource>
        </resources>
    </configuration>
</plugin>

I will try to test it with the new version.

TheProgenitus commented 8 years ago

I tried it with the new version:

XXX@verne /cygdrive/c/Users/XXX/Documents/YYY/projects/ZZZ/content
$ /cygdrive/c/Users/XXX/Programme/apache-maven-3.2.5/bin/mvn sass:update-stylesheets
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ZZZ Base CRX Package 1.15.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sass-maven-plugin:2.15:update-stylesheets (default-cli) @ ZZZ-content ---
[INFO] Checked 0 files for C:\Users\XXX\Documents\YYY\projects\ZZZ\content\src\main\sass
[INFO] Checked 0 files for C:\Users\XXX\Documents\YYY\projects\ZZZ\content\target\ZZZ-content-1.15.0-SNAPSHOT\css
[INFO] Compiling Sass templates
[INFO] Queueing Sass template for compile: C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/scss => C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/css
[INFO] Queueing Sass template for compile: C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/scss => C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/css
[ERROR] Compilation of template C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/frontendbase/scss/main.scss failed: Invalid Windows-1252 character "\xC3"
[INFO]     >> C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/scss/ink.scss => C:/Users/XXX/Documents/YYY/projects/ZZZ/content/src/main/content/jcr_root/etc/clientlibs/ZZZ/base/newsletter/css/ink.css
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.467 s
[INFO] Finished at: 2016-02-17T17:59:46+01:00
[INFO] Final Memory: 93M/837M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal nl.geodienstencentrum.maven:sass-maven-plugin:2.15:update-stylesheets (default-cli) on project ZZZ-content: Sass compilation encountered errors (see above for details). -> [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/MojoFailureException`
TheProgenitus commented 8 years ago

The invalid character in main.scss may be sone unicode character. Since the native language is not english there may be some umlauts in comments. But compiling from the windows cmd doesn't give that error. There the compilation finishes without any failure.

mprins commented 8 years ago

your shell may be forcing the charset; while cmd does not or uses UTF-8, try adding a CHARSET directive in main.scss (@charset "UTF-8";) or changing the charset for bash (I have no idea how to do that). I think you have an error in your scss, not specifying a charset and then compiling with an environment (bash) that uses something different than utf-8

also, you have specified your resources to use ${basedir} which is expanded by maven to be an absolute path; AFAIK you can just use relative paths in resources, just like you did with the compassConfigFile config param, relative needs to be relative to the project root (where pom.xml lives)

TheProgenitus commented 8 years ago

The charset directive is already in the main.scss. I have removed the ${basedir} and the output shows now relative paths (with the new version; the old one 2.9-RC1 shows an absolute path for the output directory) But seems to be an encoding issue at the moment. Thanks for your help.

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.