Sometimes the Scala plugin doesn’t infer the compiler version correctly. According to the docs:
“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.”
However, I have a project with the following dependencies:
compile ‘org.scala-lang:scala-library:2.10.1’ compile ‘com.wordnik:swagger-codegen_2.10:2.0.11’
and if I call gradle run (using the application plugin), the generated classpath will have version 2.10.0 of the compiler (I believe that’s because of a transitive dependency). This can be fixed by explicitly adding version 2.10.1 to the dependencies, in which case the correct version is added to the cp.
I noticed the problem because one of the libraries was throwing the following:
which can only be fixed by using the compiler library version 2.10.1 (or above).
I assume Gradle picks up the transitive dependency (v 2.10.1) without a warning. I believe it would be nice to have a warning if this happens.