Why does sbt say “bad symbolic reference…” for test with ScalaTest?

前端 未结 1 1785
感情败类
感情败类 2021-01-12 12:22

I started using ScalaTest with sbt. The build.sbt is as follows:

name := \"MySpecSample\"

version := \"1.0\"

libraryDependencies  += \"org         


        
相关标签:
1条回答
  • 2021-01-12 13:19

    In your build.sbt you set the version of Scala to 2.10.3 with the following:

    scalaVersion := "2.10.3" 
    

    However the ScalaTest dependency uses Scala 2.11 explicitly (note the _2.11 part):

    "org.scalatest" % "scalatest_2.11" % "2.2.0" % "test"
    

    You have to use the same major scala version for both.

    With sbt you can simply ensure this using %% instead of % as follows:

    "org.scalatest" %% "scalatest" % "2.2.0" % "test"
    
    0 讨论(0)
提交回复
热议问题