diff --git a/ivy/src/main/scala/sbt/IvyScala.scala b/ivy/src/main/scala/sbt/IvyScala.scala
index 81d19dd87..c3baaa03b 100644
--- a/ivy/src/main/scala/sbt/IvyScala.scala
+++ b/ivy/src/main/scala/sbt/IvyScala.scala
@@ -7,9 +7,10 @@ import java.util.Collections.emptyMap
import scala.collection.mutable.HashSet
import org.apache.ivy.core.module.descriptor.{ DefaultExcludeRule, ExcludeRule }
-import org.apache.ivy.core.module.descriptor.{ DependencyDescriptor, DefaultModuleDescriptor, ModuleDescriptor, OverrideDependencyDescriptorMediator }
+import org.apache.ivy.core.module.descriptor.{ DefaultDependencyDescriptor, DependencyDescriptor, DependencyDescriptorMediator, DefaultModuleDescriptor, ModuleDescriptor, OverrideDependencyDescriptorMediator }
import org.apache.ivy.core.module.id.{ ArtifactId, ModuleId, ModuleRevisionId }
import org.apache.ivy.plugins.matcher.ExactPatternMatcher
+import org.apache.ivy.plugins.namespace.NamespaceTransformer
object ScalaArtifacts {
import xsbti.ArtifactInfo._
@@ -17,6 +18,8 @@ object ScalaArtifacts {
val LibraryID = ScalaLibraryID
val CompilerID = ScalaCompilerID
val ReflectID = "scala-reflect"
+ val ActorsID = "scala-actors"
+ val ScalapID = "scalap"
val DottyIDPrefix = "dotty"
def dottyID(binaryVersion: String): String = s"${DottyIDPrefix}_${binaryVersion}"
@@ -47,17 +50,41 @@ private object IvyScala {
/** Performs checks/adds filters on Scala dependencies (if enabled in IvyScala). */
def checkModule(module: DefaultModuleDescriptor, conf: String, log: Logger)(check: IvyScala): Unit = {
if (check.checkExplicit)
- checkDependencies(module, check.scalaBinaryVersion, check.configurations, log)
+ checkDependencies(module, check.scalaOrganization, check.scalaBinaryVersion, check.configurations, log)
if (check.filterImplicit)
excludeScalaJars(module, check.configurations)
if (check.overrideScalaVersion)
- overrideScalaVersion(module, check.scalaFullVersion)
+ overrideScalaVersion(module, check.scalaOrganization, check.scalaFullVersion)
}
- def overrideScalaVersion(module: DefaultModuleDescriptor, version: String): Unit = {
- overrideVersion(module, Organization, LibraryID, version)
- overrideVersion(module, Organization, CompilerID, version)
- overrideVersion(module, Organization, ReflectID, version)
+
+ class OverrideScalaMediator(scalaOrganization: String, scalaVersion: String) extends DependencyDescriptorMediator {
+ def mediate(dd: DependencyDescriptor): DependencyDescriptor = {
+ val transformer =
+ new NamespaceTransformer {
+ def transform(mrid: ModuleRevisionId): ModuleRevisionId = {
+ if (mrid == null) mrid
+ else
+ mrid.getName match {
+ case name @ (CompilerID | LibraryID | ReflectID | ActorsID | ScalapID) =>
+ ModuleRevisionId.newInstance(scalaOrganization, name, mrid.getBranch, scalaVersion, mrid.getQualifiedExtraAttributes)
+ case _ => mrid
+ }
+ }
+
+ def isIdentity: Boolean = false
+ }
+
+ DefaultDependencyDescriptor.transformInstance(dd, transformer, false)
+ }
}
+
+ def overrideScalaVersion(module: DefaultModuleDescriptor, organization: String, version: String): Unit = {
+ val mediator = new OverrideScalaMediator(organization, version)
+ module.addDependencyDescriptorMediator(new ModuleId(Organization, "*"), ExactPatternMatcher.INSTANCE, mediator)
+ if (organization != Organization)
+ module.addDependencyDescriptorMediator(new ModuleId(organization, "*"), ExactPatternMatcher.INSTANCE, mediator)
+ }
+
def overrideVersion(module: DefaultModuleDescriptor, org: String, name: String, version: String): Unit = {
val id = new ModuleId(org, name)
val over = new OverrideDependencyDescriptorMediator(null, version)
@@ -68,13 +95,13 @@ private object IvyScala {
* Checks the immediate dependencies of module for dependencies on scala jars and verifies that the version on the
* dependencies matches scalaVersion.
*/
- private def checkDependencies(module: ModuleDescriptor, scalaBinaryVersion: String, configurations: Iterable[Configuration], log: Logger): Unit = {
+ private def checkDependencies(module: ModuleDescriptor, scalaOrganization: String, scalaBinaryVersion: String, configurations: Iterable[Configuration], log: Logger): Unit = {
val configSet = if (configurations.isEmpty) (c: String) => true else configurationSet(configurations)
def binaryScalaWarning(dep: DependencyDescriptor): Option[String] =
{
val id = dep.getDependencyRevisionId
val depBinaryVersion = CrossVersion.binaryScalaVersion(id.getRevision)
- def isScalaLangOrg = id.getOrganisation == Organization
+ def isScalaLangOrg = id.getOrganisation == scalaOrganization
def isNotScalaActorsMigration = !(id.getName startsWith "scala-actors-migration") // Exception to the rule: sbt/sbt#1818
def isNotScalaPickling = !(id.getName startsWith "scala-pickling") // Exception to the rule: sbt/sbt#1899
def hasBinVerMismatch = depBinaryVersion != scalaBinaryVersion
diff --git a/ivy/src/test/scala/BaseIvySpecification.scala b/ivy/src/test/scala/BaseIvySpecification.scala
index a8a19ea76..aadf245ab 100644
--- a/ivy/src/test/scala/BaseIvySpecification.scala
+++ b/ivy/src/test/scala/BaseIvySpecification.scala
@@ -16,7 +16,7 @@ trait BaseIvySpecification extends Specification {
def configurations = Seq(Compile, Test, Runtime)
def module(moduleId: ModuleID, deps: Seq[ModuleID], scalaFullVersion: Option[String],
- uo: UpdateOptions = UpdateOptions()): IvySbt#Module = {
+ uo: UpdateOptions = UpdateOptions(), overrideScalaVersion: Boolean = true): IvySbt#Module = {
val ivyScala = scalaFullVersion map { fv =>
new IvyScala(
scalaFullVersion = fv,
@@ -24,7 +24,7 @@ trait BaseIvySpecification extends Specification {
configurations = Nil,
checkExplicit = true,
filterImplicit = false,
- overrideScalaVersion = false)
+ overrideScalaVersion = overrideScalaVersion)
}
val moduleSetting: ModuleSettings = InlineConfiguration(
diff --git a/ivy/src/test/scala/EvictionWarningSpec.scala b/ivy/src/test/scala/EvictionWarningSpec.scala
index 0e1e3dd2c..cb55cbe36 100644
--- a/ivy/src/test/scala/EvictionWarningSpec.scala
+++ b/ivy/src/test/scala/EvictionWarningSpec.scala
@@ -7,12 +7,16 @@ class EvictionWarningSpec extends BaseIvySpecification {
This is a specification to check the eviction warnings
- Eviction of scala-library whose scalaVersion should
+ Eviction of non-overridden scala-library whose scalaVersion should
be detected $scalaVersionWarn1
- not be detected if it's diabled $scalaVersionWarn2
+ not be detected if it's disabled $scalaVersionWarn2
print out message about the eviction $scalaVersionWarn3
print out message about the eviction with callers $scalaVersionWarn4
+ Non-eviction of overridden scala-library whose scalaVersion should
+ not be detected if it's enabled $scalaVersionWarn5
+ not be detected if it's disabled $scalaVersionWarn6
+
Including two (suspect) binary incompatible Java libraries to
direct dependencies should
be detected as eviction $javaLibWarn1
@@ -69,19 +73,19 @@ class EvictionWarningSpec extends BaseIvySpecification {
def scalaVersionDeps = Seq(scala2102, akkaActor230)
def scalaVersionWarn1 = {
- val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
+ val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
val report = ivyUpdate(m)
EvictionWarning(m, defaultOptions, report, log).scalaEvictions must have size (1)
}
def scalaVersionWarn2 = {
- val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
+ val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
val report = ivyUpdate(m)
EvictionWarning(m, defaultOptions.withWarnScalaVersionEviction(false), report, log).scalaEvictions must have size (0)
}
def scalaVersionWarn3 = {
- val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
+ val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
val report = ivyUpdate(m)
EvictionWarning(m, defaultOptions, report, log).lines must_==
List("Scala version was updated by one of library dependencies:",
@@ -92,7 +96,7 @@ class EvictionWarningSpec extends BaseIvySpecification {
}
def scalaVersionWarn4 = {
- val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
+ val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"), overrideScalaVersion = false)
val report = ivyUpdate(m)
EvictionWarning(m, defaultOptions.withShowCallers(true), report, log).lines must_==
List("Scala version was updated by one of library dependencies:",
@@ -101,6 +105,18 @@ class EvictionWarningSpec extends BaseIvySpecification {
"\tivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }")
}
+ def scalaVersionWarn5 = {
+ val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
+ val report = ivyUpdate(m)
+ EvictionWarning(m, defaultOptions, report, log).scalaEvictions must have size (0)
+ }
+
+ def scalaVersionWarn6 = {
+ val m = module(defaultModuleId, scalaVersionDeps, Some("2.10.2"))
+ val report = ivyUpdate(m)
+ EvictionWarning(m, defaultOptions.withWarnScalaVersionEviction(false), report, log).scalaEvictions must have size (0)
+ }
+
def javaLibDirectDeps = Seq(commonsIo14, commonsIo24)
def javaLibWarn1 = {
diff --git a/ivy/src/test/scala/ScalaOverrideTest.scala b/ivy/src/test/scala/ScalaOverrideTest.scala
new file mode 100644
index 000000000..9165487bd
--- /dev/null
+++ b/ivy/src/test/scala/ScalaOverrideTest.scala
@@ -0,0 +1,75 @@
+package sbt
+
+import java.io.File
+import org.apache.ivy.core.module.id.{ ModuleId, ModuleRevisionId }
+import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor
+import org.specs2._
+import mutable.Specification
+
+import cross.CrossVersionUtil
+import IvyScala.OverrideScalaMediator
+import ScalaArtifacts._
+
+object ScalaOverrideTest extends Specification {
+ val OtherOrgID = "other.org"
+
+ def check(org0: String, version0: String)(org1: String, name1: String, version1: String) = {
+ val osm = new OverrideScalaMediator(org0, version0)
+
+ val mrid = ModuleRevisionId.newInstance(org1, name1, version1)
+ val dd = new DefaultDependencyDescriptor(mrid, false)
+
+ val res = osm.mediate(dd)
+ res.getDependencyRevisionId must_== ModuleRevisionId.newInstance(org0, name1, version0)
+ }
+
+ "OverrideScalaMediator" should {
+ "Override compiler version" in {
+ check(Organization, "2.11.8")(Organization, CompilerID, "2.11.9")
+ }
+ "Override library version" in {
+ check(Organization, "2.11.8")(Organization, LibraryID, "2.11.8")
+ }
+ "Override reflect version" in {
+ check(Organization, "2.11.8")(Organization, ReflectID, "2.11.7")
+ }
+ "Override actors version" in {
+ check(Organization, "2.11.8")(Organization, ActorsID, "2.11.6")
+ }
+ "Override scalap version" in {
+ check(Organization, "2.11.8")(Organization, ScalapID, "2.11.5")
+ }
+
+ "Override default compiler organization" in {
+ check(OtherOrgID, "2.11.8")(Organization, CompilerID, "2.11.9")
+ }
+ "Override default library organization" in {
+ check(OtherOrgID, "2.11.8")(Organization, LibraryID, "2.11.8")
+ }
+ "Override default reflect organization" in {
+ check(OtherOrgID, "2.11.8")(Organization, ReflectID, "2.11.7")
+ }
+ "Override default actors organization" in {
+ check(OtherOrgID, "2.11.8")(Organization, ActorsID, "2.11.6")
+ }
+ "Override default scalap organization" in {
+ check(OtherOrgID, "2.11.8")(Organization, ScalapID, "2.11.5")
+ }
+
+ "Override custom compiler organization" in {
+ check(Organization, "2.11.8")(OtherOrgID, CompilerID, "2.11.9")
+ }
+ "Override custom library organization" in {
+ check(Organization, "2.11.8")(OtherOrgID, LibraryID, "2.11.8")
+ }
+ "Override custom reflect organization" in {
+ check(Organization, "2.11.8")(OtherOrgID, ReflectID, "2.11.7")
+ }
+ "Override custom actors organization" in {
+ check(Organization, "2.11.8")(OtherOrgID, ActorsID, "2.11.6")
+ }
+ "Override custom scalap organization" in {
+ check(Organization, "2.11.8")(OtherOrgID, ScalapID, "2.11.5")
+ }
+ }
+}
diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala
index e62eb84c8..4b34f0957 100755
--- a/main/src/main/scala/sbt/Defaults.scala
+++ b/main/src/main/scala/sbt/Defaults.scala
@@ -1183,7 +1183,7 @@ object Classpaths {
projectDependencies.value ++ libraryDependencies.value
},
ivyScala <<= ivyScala or (scalaHome, scalaVersion in update, scalaBinaryVersion in update, scalaOrganization, sbtPlugin) { (sh, fv, bv, so, plugin) =>
- Some(new IvyScala(fv, bv, Nil, filterImplicit = false, checkExplicit = true, overrideScalaVersion = plugin, scalaOrganization = so))
+ Some(new IvyScala(fv, bv, Nil, filterImplicit = false, checkExplicit = true, overrideScalaVersion = true, scalaOrganization = so))
},
artifactPath in makePom <<= artifactPathSetting(artifact in makePom),
publishArtifact in makePom := publishMavenStyle.value && publishArtifact.value,
diff --git a/notes/0.13.12/scala-override.md b/notes/0.13.12/scala-override.md
new file mode 100644
index 000000000..095734ca1
--- /dev/null
+++ b/notes/0.13.12/scala-override.md
@@ -0,0 +1,17 @@
+ [milessabin]: https://github.com/milessabin
+ [2286]: https://github.com/sbt/sbt/issues/2286
+ [2634]: https://github.com/sbt/sbt/pull/2634
+
+### Fixes with compatibility implications
+
+- By default the Scala toolchain artefacts are now transitively resolved using the provided `scalaVersion` and
+ `scalaOrganization`. Previously a user specified `scalaOrganization` would not have affected transitive
+ dependencies on, eg. `scala-reflect`. An Ivy-level mechanism is used for this purpose, and as a consequence
+ the overriding happens early in the resolution process which might improve resolution times, and as a side
+ benefit fixes [#2286][2286]. The old behaviour can be restored by adding
+ `ivyScala := { ivyScala.value map {_.copy(overrideScalaVersion = sbtPlugin.value)} }`
+ to your build. [#2286][2286]/[#2634][2634] by [@milessabin][milessabin]
+
+### Improvements
+
+### Bug fixes
diff --git a/sbt/src/sbt-test/dependency-management/exclude-scala/project/ExcludeScala.scala b/sbt/src/sbt-test/dependency-management/exclude-scala/project/ExcludeScala.scala
index 25eaec81d..40171bc0f 100644
--- a/sbt/src/sbt-test/dependency-management/exclude-scala/project/ExcludeScala.scala
+++ b/sbt/src/sbt-test/dependency-management/exclude-scala/project/ExcludeScala.scala
@@ -1,27 +1,28 @@
- import sbt._
- import Keys._
+import sbt._
+import Keys._
object ExcludeScala extends Build
{
- lazy val root = Project("root", file(".")) settings(
- libraryDependencies <++= baseDirectory(dependencies),
- scalaVersion := "2.9.2",
- autoScalaLibrary <<= baseDirectory(base => !(base / "noscala").exists ),
- scalaOverride <<= check("scala.App")
- )
- def check(className: String): Def.Initialize[Task[Unit]] = fullClasspath in Compile map { cp =>
- val existing = cp.files.filter(_.getName contains "scala-library")
- println("Full classpath: " + cp.mkString("\n\t", "\n\t", ""))
- println("scala-library.jar: " + existing.mkString("\n\t", "\n\t", ""))
- val loader = classpath.ClasspathUtilities.toLoader(existing)
- Class.forName(className, false, loader)
- }
+ lazy val root = Project("root", file(".")) settings(
+ libraryDependencies <++= baseDirectory(dependencies),
+ scalaVersion := "2.9.2",
+ ivyScala := { ivyScala.value map {_.copy(overrideScalaVersion = sbtPlugin.value)} },
+ autoScalaLibrary <<= baseDirectory(base => !(base / "noscala").exists ),
+ scalaOverride <<= check("scala.App")
+ )
+ def check(className: String): Def.Initialize[Task[Unit]] = fullClasspath in Compile map { cp =>
+ val existing = cp.files.filter(_.getName contains "scala-library")
+ println("Full classpath: " + cp.mkString("\n\t", "\n\t", ""))
+ println("scala-library.jar: " + existing.mkString("\n\t", "\n\t", ""))
+ val loader = classpath.ClasspathUtilities.toLoader(existing)
+ Class.forName(className, false, loader)
+ }
- lazy val scalaOverride = taskKey[Unit]("Check that the proper version of Scala is on the classpath.")
+ lazy val scalaOverride = taskKey[Unit]("Check that the proper version of Scala is on the classpath.")
- def dependencies(base: File) =
- if( ( base / "stm").exists )
- ("org.scala-tools" % "scala-stm_2.8.2" % "0.6") :: Nil
- else
- Nil
-}
\ No newline at end of file
+ def dependencies(base: File) =
+ if( ( base / "stm").exists )
+ ("org.scala-tools" % "scala-stm_2.8.2" % "0.6") :: Nil
+ else
+ Nil
+}
diff --git a/sbt/src/sbt-test/dependency-management/scala-organization/build.sbt b/sbt/src/sbt-test/dependency-management/scala-organization/build.sbt
new file mode 100644
index 000000000..217b3f4d7
--- /dev/null
+++ b/sbt/src/sbt-test/dependency-management/scala-organization/build.sbt
@@ -0,0 +1,54 @@
+organization := "org.dummy"
+
+scalaOrganization := "org.other"
+
+scalaVersion := "2.11.8"
+
+resolvers += Resolver.file("buggy", (baseDirectory in LocalRootProject).value / "repo")(
+ Patterns(
+ ivyPatterns = Seq("[organization]/[module]/[revision]/ivy.xml"),
+ artifactPatterns = Seq("[organization]/[module]/[revision]/dummy.jar"),
+ isMavenCompatible = false,
+ descriptorOptional = true,
+ skipConsistencyCheck = true
+ )
+)
+
+libraryDependencies += "org.typelevel" %% "cats" % "0.6.0"
+
+val checkDependencies = taskKey[Unit]("Checks that dependcies are correct.")
+
+checkDependencies := {
+ val expected: Set[ModuleID] = Set(
+ "com.github.mpilquist" % "simulacrum_2.11" % "0.7.0",
+ "jline" % "jline" % "2.12.1",
+ "org.other" % "scala-compiler" % "2.11.8",
+ "org.other" % "scala-library" % "2.11.8",
+ "org.other" % "scala-reflect" % "2.11.8",
+ "org.scala-lang.modules" % "scala-parser-combinators_2.11" % "1.0.4",
+ "org.scala-lang.modules" % "scala-xml_2.11" % "1.0.5",
+ "org.scala-sbt" % "test-interface" % "1.0",
+ "org.scalacheck" % "scalacheck_2.11" % "1.12.5",
+ "org.typelevel" % "catalysts-macros_2.11" % "0.0.2",
+ "org.typelevel" % "catalysts-platform_2.11" % "0.0.2",
+ "org.typelevel" % "cats-core_2.11" % "0.6.0",
+ "org.typelevel" % "cats-free_2.11" % "0.6.0",
+ "org.typelevel" % "cats-kernel-laws_2.11" % "0.6.0",
+ "org.typelevel" % "cats-kernel_2.11" % "0.6.0",
+ "org.typelevel" % "cats-laws_2.11" % "0.6.0",
+ "org.typelevel" % "cats-macros_2.11" % "0.6.0",
+ "org.typelevel" % "cats_2.11" % "0.6.0",
+ "org.typelevel" % "discipline_2.11" % "0.4",
+ "org.typelevel" % "machinist_2.11" % "0.4.1",
+ "org.typelevel" % "macro-compat_2.11" % "1.1.0"
+ )
+
+ val resolved: Set[ModuleID] =
+ (for {
+ c <- update.value.configurations
+ m <- c.modules
+ if !m.evicted
+ } yield m.module.copy(extraAttributes = Map.empty)).toSet
+
+ assert(resolved == expected)
+}
diff --git a/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-compiler/2.11.8/dummy.jar b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-compiler/2.11.8/dummy.jar
new file mode 100644
index 000000000..e69de29bb
diff --git a/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-compiler/2.11.8/ivy.xml b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-compiler/2.11.8/ivy.xml
new file mode 100644
index 000000000..c0252721f
--- /dev/null
+++ b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-compiler/2.11.8/ivy.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+ Scala Compiler
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-library/2.11.8/dummy.jar b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-library/2.11.8/dummy.jar
new file mode 100644
index 000000000..e69de29bb
diff --git a/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-library/2.11.8/ivy.xml b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-library/2.11.8/ivy.xml
new file mode 100644
index 000000000..fb4924a58
--- /dev/null
+++ b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-library/2.11.8/ivy.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+ Scala Standard Library
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-reflect/2.11.8/dummy.jar b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-reflect/2.11.8/dummy.jar
new file mode 100644
index 000000000..e69de29bb
diff --git a/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-reflect/2.11.8/ivy.xml b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-reflect/2.11.8/ivy.xml
new file mode 100644
index 000000000..169793932
--- /dev/null
+++ b/sbt/src/sbt-test/dependency-management/scala-organization/repo/org.other/scala-reflect/2.11.8/ivy.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+ Scala Reflection Library
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sbt/src/sbt-test/dependency-management/scala-organization/test b/sbt/src/sbt-test/dependency-management/scala-organization/test
new file mode 100644
index 000000000..9329a1c80
--- /dev/null
+++ b/sbt/src/sbt-test/dependency-management/scala-organization/test
@@ -0,0 +1 @@
+> checkDependencies
diff --git a/sbt/src/sbt-test/tests/scala-instance-classloader/build.sbt b/sbt/src/sbt-test/tests/scala-instance-classloader/build.sbt
index 65dabf892..f1ed151ad 100644
--- a/sbt/src/sbt-test/tests/scala-instance-classloader/build.sbt
+++ b/sbt/src/sbt-test/tests/scala-instance-classloader/build.sbt
@@ -27,3 +27,5 @@ libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.3" % "test"
scalaVersion := "2.11.0"
+
+ivyScala := ivyScala.value map {_.copy(overrideScalaVersion = sbtPlugin.value)}