Skip to content

Commit 9091f4d

Browse files
committed
Override scalaInstance to avoid circular dep problem
In sbt/sbt#1872, we've got a good suggestion to specify ScalaInstance manually and use sbt's launcher as a context for Ivy resolution. This way we avoid circular dependency problem describe in the issue.
1 parent 80acfe2 commit 9091f4d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

build.sbt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ lazy val commonSettings = Seq[Setting[_]](
5858
crossPaths := false,
5959
// do not add Scala library jar as a dependency automatically
6060
autoScalaLibrary := false,
61+
// we also do not add scala instance automatically because it introduces
62+
// a circular instance, see: https://github.com/sbt/sbt/issues/1872
63+
managedScalaInstance := false,
64+
// this is a way to workaround issue described in https://github.com/sbt/sbt/issues/1872
65+
// check it out for more details
66+
scalaInstance := ScalaInstance(scalaVersion.value, appConfiguration.value.provider.scalaProvider.launcher getScala scalaVersion.value),
6167
// we always assume that Java classes are standalone and do not have any dependency
6268
// on Scala classes
6369
compileOrder := CompileOrder.JavaThenScala,

0 commit comments

Comments
 (0)