У меня есть проект с использованием Scala 2.10 и один с использованием Scala 2.11. Они зависят от общего проекта, который может скомпилироваться с обоими.
lazy val foo = (project in file("foo")).dependsOn(baz).settings(
scalaVersion := "2.10.4"
)
lazy val bar = (project in file("bar")).dependsOn(baz).settings(
scalaVersion := "2.11.4"
)
lazy val baz = (project in file("baz")).settings(
crossScalaVersions := Seq("2.10.4", "2.11.4"),
scalaVersion := "2.10.4"
)
И затем
$ sbt bar/update
[info] Updating {file:/home/paul/Private/test/}bar...
[info] Resolving baz#baz_2.11;0.1-SNAPSHOT ...
[warn] module not found: baz#baz_2.11;0.1-SNAPSHOT
[warn] ==== local: tried
[warn] /home/paul/.ivy2/local/baz/baz_2.11/0.1-SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/baz/baz_2.11/0.1-SNAPSHOT/baz_2.11-0.1-SNAPSHOT.pom
[info] Resolving jline#jline;2.12 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: baz#baz_2.11;0.1-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last bar/*:update for the full output.
[error] (bar/*:update) sbt.ResolveException: unresolved dependency: baz#baz_2.11;0.1-SNAPSHOT: not found
[error] Total time: 1 s, completed Jan 13, 2015 11:42:51 AM
Как я могу использовать baz
для обоих проектов?