无法使用 intellij 14.1 编译 scala 测试

cannot compile scala test with intellij 14.1

项目使用scala 2.9

我最大的依赖是:

    <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest_2.9.2</artifactId>
    </dependency>


Error:scalac: Error: org.jetbrains.jps.incremental.scala.remote.ServerException
Error compiling sbt component 'compiler-interface-2.9.2-50.0'
    at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$$anonfun$apply.apply(AnalyzingCompiler.scala:145)
    at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$$anonfun$apply.apply(AnalyzingCompiler.scala:142)
    at sbt.IO$.withTemporaryDirectory(IO.scala:285)
    at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources.apply(AnalyzingCompiler.scala:142)
    at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources.apply(AnalyzingCompiler.scala:139)
    at sbt.IO$.withTemporaryDirectory(IO.scala:285)
    at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:139)
    at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:33)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$.org$jetbrains$jps$incremental$scala$local$CompilerFactoryImpl$$getOrCompileInterfaceJar(CompilerFactoryImpl.scala:87)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$$anonfun$getScalac.apply(CompilerFactoryImpl.scala:44)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl$$anonfun$getScalac.apply(CompilerFactoryImpl.scala:43)
    at scala.Option.map(Option.scala:145)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.getScalac(CompilerFactoryImpl.scala:43)
    at org.jetbrains.jps.incremental.scala.local.CompilerFactoryImpl.createCompiler(CompilerFactoryImpl.scala:22)
    at org.jetbrains.jps.incremental.scala.local.CachingFactory$$anonfun$createCompiler.apply(CachingFactory.scala:24)
    at org.jetbrains.jps.incremental.scala.local.CachingFactory$$anonfun$createCompiler.apply(CachingFactory.scala:24)
    at org.jetbrains.jps.incremental.scala.local.Cache$$anonfun$getOrUpdate.apply(Cache.scala:20)
    at scala.Option.getOrElse(Option.scala:120)
    at org.jetbrains.jps.incremental.scala.local.Cache.getOrUpdate(Cache.scala:19)
    at org.jetbrains.jps.incremental.scala.local.CachingFactory.createCompiler(CachingFactory.scala:23)
    at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:22)
    at org.jetbrains.jps.incremental.scala.remote.Main$.make(Main.scala:62)
    at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:20)
    at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)

我认为你的依赖不完整,缺少库版本。最简单的是 look it up on Maven Central:

<dependency>
    <groupId>org.scalatest</groupId>
    <artifactId>scalatest_2.9.2</artifactId>
    <version>1.9.2</version> <!-- here -->
</dependency>