简体   繁体   中英

Why sbt does override scala version in subproject?

I have failed to find any answers... that is why I'm here) Below is my case:

lazy val sevone = Project(id = "sevone",
base = file("sevone")) dependsOn nmsCommons
lazy val nmsCommons = Project(id = "nms-commons",
base = file("nms-commons"))

sevone project has 2.11.0 scalaVersion and nmsCommons has 2.10.2 scalaVersion, but when I'm trying to update/compile sevone project SBT ovverrides 2.10.2 to 2.11.0 and failed with

[error] (sevone/*:update) sbt.ResolveException: unresolved dependency: network-monitoring-system-commons#network-monitoring-system-commons_2.11;1.0: not found

Scala 2.10 and 2.11 aren't binary compatible (see https://typesafe.com/blog/scala-211-has-arrived ). So it isn't possible for a 2.11 project to depend on a 2.10 project. See also Cross-Building in SBT documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM