Menu

Liferay 7: Error while buildCSS

To day, I open my old wars project and build it with Gradle. I received the error message like this:

Was passed main parameter 'sass.append.css.import.timestamps=true' but no main parameter was defined in your arg class
:wars:announcement:buildCSS


Usage: java -jar com.liferay.css.builder-3.0.0.jar [options]
  Options:
    --append-css-import-timestamps
      Whether to append the current timestamp to the URLs in the @import CSS 
      at-rules. 
      Default: true
    --base-dir
      The base directory that contains the SCSS files to compile.
      Default: src/META-INF/resources
    --compiler
      The type of Sass compiler to use. Supported values are "jni" and "ruby". 
      The Ruby Sass compiler requires "com.liferay.sass.compiler.ruby.jar", 
      "com.liferay.ruby.gems.jar", and "jruby-complete.jar" to be added to the 
      classpath. 
      Default: jni
    --dir-names
      The name of the directories, relative to base directory, which contain 
      the SCSS files to compile. All sub-directories are searched for SCSS 
      files as well.
      Default: [/]
    --excludes
      The SCSS file patterns to exclude from compiling.
      Default: [**/_diffs/**, **/.sass-cache*/**, **/.sass_cache_*/**, **/_sass_cache_*/**, **/_styled/**, **/_unstyled/**, **/css/aui/**, **/css/clay/**, **/tmp/**]
    --generate-source-map
      Whether to generate source maps for easier debugging.
      Default: false
    -h, --help
      Print this message.
    --import-paths
      The import directories of Sass libraries.
    --output-dir
      The name of the sub-directories where the SCSS files are compiled to. 
      For each directory that contains SCSS files, a sub-directory with this 
      name is created.
      Default: .sass-cache/
    --precision
      The numeric precision of numbers in Sass.
      Default: 9
    --rtl-excluded-path-regexps
      The SCSS file patterns to exclude when converting for right-to-left 
      (RTL) support.
      Default: []
I didn't know why it occur because the last time I built, it still work fine.
After an hour searching on the internet, I realized there was a new version of css builder which was release few days ago.

The last version of css builder is 3.0.0 and it did not work with the configurations of Gradle. So, the easiest way to fix it is using the previous one.

To use a specify version of css builder we need to add line:
cssBuilder group: "com.liferay", name: "com.liferay.css.builder", version: "2.1.3"
into the dependences sector at file build.gradle and rebuild your project.

Thanks!

5 nhận xét:

  1. It's Working Fine...!!!!!

    Thank You !!!

    Trả lờiXóa
  2. getting below error while building the war in gradle and i am using liferay dxp 7.1 . Please find the below error.

    :buildCSSWas passed main parameter 'sass.append.css.import.timestamps=true' but no main parameter was defined in your arg class

    Usage: java -jar com.liferay.css.builder-3.0.0.jar [options]
    Options:
    --append-css-import-timestamps
    Whether to append the current timestamp to the URLs in the @import CSS
    at-rules.
    Default: true
    --base-dir
    The base directory that contains the SCSS files to compile.
    Default: src\META-INF\resources
    --compiler
    The type of Sass compiler to use. Supported values are "jni" and "ruby".
    The Ruby Sass compiler requires "com.liferay.sass.compiler.ruby.jar",
    "com.liferay.ruby.gems.jar", and "jruby-complete.jar" to be added to the
    classpath.
    Default: jni
    --dir-names
    The name of the directories, relative to base directory, which contain
    the SCSS files to compile. All sub-directories are searched for SCSS
    files as well.
    Default: [/]
    --excludes
    The SCSS file patterns to exclude from compiling.
    Default: [**/_diffs/**, **/.sass-cache*/**, **/.sass_cache_*/**, **/_sass_cache_*/**, **/_styled/**, **/_unstyled/**, **/css/aui/**, **/css/clay/**, **/tmp/**]
    --generate-source-map
    Whether to generate source maps for easier debugging.
    Default: false
    -h, --help
    Print this message.
    --import-paths
    The import directories of Sass libraries.
    --output-dir
    The name of the sub-directories where the SCSS files are compiled to.
    For each directory that contains SCSS files, a sub-directory with this
    name is created.
    Default: .sass-cache/
    --precision
    The numeric precision of numbers in Sass.
    Default: 9
    --rtl-excluded-path-regexps
    The SCSS file patterns to exclude when converting for right-to-left
    (RTL) support.
    Default: []

    :buildCSS FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':buildCSS'.
    > Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_201\bin\java.exe'' finished with non-zero exit value 1

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    Trả lờiXóa