【问题标题】:Grails 3 "Build failed with an exception" using assets-pipeline with sass-grails-asset-pipeline使用带有 sass-grails-asset-pipeline 的资产管道的 Grails 3“构建失败并出现异常”
【发布时间】:2016-01-25 13:12:40
【问题描述】:

我正在尝试在 Grails 3 上使用 grails asset-pipeline pluginthe sass extension。不幸的是,按照文档在 build.gradle 文件中配置它们没有用,因为会生成此错误:

FAILURE: Build failed with an exception.

* Where:
Build file '/MyProject/build.gradle' line: 17

* What went wrong:
Could not compile build file '/MyProject/build.gradle'.
> startup failed:
  build file '/MyProject/build.gradle': 17: only id(String) method calls allowed in plugins {} script block

  See http://gradle.org/docs/2.3/userguide/plugins.html#sec:plugins_block for information on the plugins {} block

   @ line 17, column 5.
         provided ":sass-asset-pipeline:$assetsPipelineSassVersion"
         ^

  1 error


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

BUILD FAILED

Total time: 3.128 secs
| Error Error initializing classpath: startup failed:
build file '/MyProject/build.gradle': 17: only id(String) method calls allowed in plugins {} script block

See http://gradle.org/docs/2.3/userguide/plugins.html#sec:plugins_block for information on the plugins {} block

 @ line 17, column 5.
       provided ":sass-asset-pipeline:$assetsPipelineSassVersion"
       ^

1 error
 (Use --stacktrace to see the full trace)
0

【问题讨论】:

    标签: grails gradle asset-pipeline grails-plugin


    【解决方案1】:

    我已经找到了这个 gradle 配置的解决方案(版本变量在 gradle.properties 中定义):

    buildscript {
        dependencies {
            classpath "com.bertramlabs.plugins:asset-pipeline-gradle:$assetsPipelineVersion"
        }
    }
    
    apply plugin: 'com.bertramlabs.asset-pipeline'
    
    
    assets {
        minifyJs = true
        minifyCss = true
        from '/img'
        from '/js'
        from '/css'
        from '/fonts'
    }
    
    dependencies {
        compile "org.grails.plugins:asset-pipeline"
    
        runtime "org.grails.plugins:asset-pipeline"
        assets "com.bertramlabs.plugins:sass-asset-pipeline:$assetsPipelineSassVersion"
    }
    

    【讨论】:

      猜你喜欢
      • 2016-05-18
      • 1970-01-01
      • 2016-02-09
      • 1970-01-01
      • 2014-07-05
      • 1970-01-01
      • 1970-01-01
      • 2014-07-16
      • 1970-01-01
      相关资源
      最近更新 更多