Skip to content

Inter-project dependencies break on variant Scala binary versions #4847

@dwijnand

Description

@dwijnand

steps

sbt version: 1.2.8

build.sbt

val foo = project in file(".")

ThisBuild / organization := "com.example"
ThisBuild / scalaVersion := "2.13.0"

aggregateProjects(bar, baz)

val bar = project.settings(scalaVersion := "2.12.8")
val baz = project.dependsOn(bar % Runtime)

problem

> baz/run
[... running log and sbt internal stacktrace ...]
[error] (baz / update) sbt.librarymanagement.ResolveException: Error downloading com.example:bar_2.13:0.1.0-SNAPSHOT
[error]   Not found
[error]   not found: /Users/dnw/.ivy2/local/com.example/bar_2.13/0.1.0-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/com/example/bar_2.13/0.1.0-SNAPSHOT/bar_2.13-0.1.0-SNAPSHOT.pom
[error]   not found: https://repo.typesafe.com/typesafe/ivy-releases/com.example/bar_2.13/0.1.0-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/com.example/bar_2.13/0.1.0-SNAPSHOT/ivys/ivy.xml
[error] Total time: 1 s, completed 08-Jul-2019 16:52:21

expectation

I expect baz / update to resolve the project bar that it depends on, compile it and then put it on project baz's runtime classpath for baz's execution.

notes

The use of a 2.12 library in a 2.13 library is safeguarded by the use of classloaders and java reflection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions