Gradle Scala Plugin - how to specify zincClasspath

淺唱寂寞╮ 提交于 2019-12-19 19:58:21

问题


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....


回答1:


Fixed this myself in the end, the clue was that it was running on my Local machine but not my VM... of course my Gradle version was different.

Upgrading to Gradle 3.0 fixed this




回答2:


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


来源:https://stackoverflow.com/questions/40486489/gradle-scala-plugin-how-to-specify-zincclasspath

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!