diff --git a/ivy/src/main/scala/sbt/Ivy.scala b/ivy/src/main/scala/sbt/Ivy.scala index b8540fd68..ef9b695e9 100644 --- a/ivy/src/main/scala/sbt/Ivy.scala +++ b/ivy/src/main/scala/sbt/Ivy.scala @@ -536,14 +536,18 @@ private[sbt] object IvySbt { { import IvyRetrieve.toModuleID val dds = moduleID.getDependencies - inconsistentDuplicateWarning(dds map { dd => toModuleID(dd.getDependencyRevisionId) }) + val deps = dds flatMap { dd => + val module = toModuleID(dd.getDependencyRevisionId) + dd.getModuleConfigurations map (c => module.copy(configurations = Some(c))) + } + inconsistentDuplicateWarning(deps) } def inconsistentDuplicateWarning(dependencies: Seq[ModuleID]): List[String] = { val warningHeader = "Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:" val out: mutable.ListBuffer[String] = mutable.ListBuffer() - (dependencies groupBy { dep => (dep.organization, dep.name) }) foreach { + (dependencies groupBy { dep => (dep.organization, dep.name, dep.configurations) }) foreach { case (k, vs) if vs.size > 1 => val v0 = vs.head (vs find { _.revision != v0.revision }) foreach { v => diff --git a/ivy/src/test/scala/InconsistentDuplicateSpec.scala b/ivy/src/test/scala/InconsistentDuplicateSpec.scala index b9f4a05ef..34a5a441f 100644 --- a/ivy/src/test/scala/InconsistentDuplicateSpec.scala +++ b/ivy/src/test/scala/InconsistentDuplicateSpec.scala @@ -9,6 +9,7 @@ class InconsistentDuplicateSpec extends Specification { Duplicate with different version should be warned $warn1 + not be warned if in different configurations $nodupe2 Duplicate with same version should not be warned $nodupe1 @@ -25,4 +26,8 @@ class InconsistentDuplicateSpec extends Specification { def nodupe1 = IvySbt.inconsistentDuplicateWarning(Seq(akkaActor230Test, akkaActor230)) must_== Nil + + def nodupe2 = + IvySbt.inconsistentDuplicateWarning(Seq(akkaActor214, akkaActor230Test)) must_== Nil + }