From the Gradle documentation for the Scala plugin, you should add the Scala library dependency to the compilation class path. For instance:
compile "org.scala-lang:scala-library:2.12.4" compile "org.scala-lang:scala-reflect:2.12.4"
To integrate with IntelliJ IDEA you can use the idea plugin:
apply plugin: 'idea'
Adding a Scala library to the compilation class path is required even if your source code is only in test code. After that, IntelliJ will automatically install the Scala SDK for you.
source share