Trying to cross compile a project to Scala 2.11 fails with “error while loading Object, Missing dependency 'object scala in compiler mirror'”

前端 未结 5 1931
余生分开走
余生分开走 2020-12-11 00:41

I\'m trying to compile my project to Scala 2.10 and 2.11 so that I can release versions for both scala versions, but every time I try to do it it fails with the following me

5条回答
  •  Happy的楠姐
    2020-12-11 01:29

    The problem is very simple, in your Build.scala, you did almost all right, but in commons project you had overridden default commonDependencies. By default it contains dependency to scala-library.

    This piece of code

    lazy val common = Project(
        id = commonName,
        base = file(commonName),
        settings = Configuration.baseSettings ++ Seq(
          name := commonName,
          libraryDependencies := Configuration.commonDependencies // #1
        )
      )
    

    at the element marked as #1 should have

    libraryDependencies ++= Configuration.commonDependencies
    

    Ps. I've sent you a pull request with the fix.

提交回复
热议问题