score:4

https://docs.gradle.org/current/userguide/scala_plugin.html:

Unless a task's scalaClasspath is configured explicitly, the Scala (base) plugin will try to infer it from the task's classpath. This is done as follows:

If a scala-library Jar is found on classpath, and the project has at least one repository declared, a corresponding scala-compiler repository dependency will be added to scalaClasspath.

Otherwise, execution of the task will fail with a message saying that scalaClasspath could not be inferred.

i.e. you need to add

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

to build.gradle. If you want to build a stand-alone jar, see Building a uberjar with Gradle.

As Rex Kerr mentions, if you don't have a specific reason to use Gradle, I'd go with SBT for a Scala project.


Related Query

More Query from same tag