Gradle Scala Plugin - 如何指定zincClasspath [英] Gradle Scala Plugin - how to specify zincClasspath

查看:488
本文介绍了Gradle Scala Plugin - 如何指定zincClasspath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Gradle中的Scala插件用于在Ubuntu VM上构建我的项目。这是我的build.gradle文件的样子:

  apply plugin:'scala'
repositories {
mavenCentral()
}

依赖关系{
compile'org.scala-lang:scala-library:2.11.8'
}
code>

当我从命令行运行 gradle build 时,出现以下错误:

 失败:生成失败并出现异常。 

*发生了什么问题:
配置任务':compileScala'时发现问题。
>没有为属性'zincClasspath'指定值。

我已经查找了指定这个zincClasspath属性的位置,但是找不到任何东西。 p>

我试图强制zincClasspath使用旧版本的scala库,但它似乎无法工作。



非常感谢任何帮助

编辑:

有一点需要补充,这个确切的项目构建可以在我的本地Windows机器上运行,但是不能运行在我的Ubuntu VM上。

解决方案

最近我遇到了这个问题,将以下内容添加到我的Gradle构建脚本中似乎解决了这个问题:

  ScalaCompileOptions.metaClass.daemonServer = true 
ScalaCompileOptions。 metaClass.fork = true
ScalaCompileOptions.metaClass.useAnt = false
ScalaCompileOptions.metaClass.useCompileDaemon = false


I am trying to use the Scala plugin with Gradle to build my project on an Ubuntu VM. This is what my build.gradle file looks like:

apply plugin: 'scala'
repositories {
     mavenCentral()
}

dependencies {
    compile 'org.scala-lang:scala-library:2.11.8'
}

when I run gradle build from the command line, I get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':compileScala'.
> No value has been specified for property 'zincClasspath'.

I have looked around for where to specify this zincClasspath property, but can't find anything.

I have tried to force the zincClasspath to use an older version of the scala library, but it doesn't seem to work.

Any help is much appreciated

Edit:

One thing to add, this exact project builds fine on my local Windows machine, but not on my Ubuntu VM....

解决方案

I ran into this issue again recently, adding the following to my Gradle build script seemed to fix it:

ScalaCompileOptions.metaClass.daemonServer = true
ScalaCompileOptions.metaClass.fork = true
ScalaCompileOptions.metaClass.useAnt = false
ScalaCompileOptions.metaClass.useCompileDaemon = false

这篇关于Gradle Scala Plugin - 如何指定zincClasspath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆