Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Scala Plugin - how to specify zincClasspath

Tags:

gradle

scala

zinc

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

like image 380
JamesWillett Avatar asked Nov 08 '16 12:11

JamesWillett


People also ask

What is runtimeClasspath in Gradle?

runtimeClasspath' contains the compiled classes of the source set, and task autowiring automatically adds the necessary task dependencies. Maybe you want 'sourceSets. main. compileClasspath'.

Which are the two types of plugins in Gradle?

There are two general types of plugins in Gradle, binary plugins and script plugins.


1 Answers

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
like image 66
JamesWillett Avatar answered Nov 15 '22 04:11

JamesWillett