@@ -31,7 +31,7 @@ private[sbt] object MergeDescriptors {
31
31
32
32
// combines the artifacts, configurations, includes, and excludes for DependencyDescriptors `a` and `b`
33
33
// that otherwise have equal IDs
34
- private final class MergedDescriptors (a : DependencyDescriptor , b : DependencyDescriptor ) extends DependencyDescriptor {
34
+ private [sbt] final case class MergedDescriptors (a : DependencyDescriptor , b : DependencyDescriptor ) extends DependencyDescriptor {
35
35
def getDependencyId = a.getDependencyId
36
36
def isForce = a.isForce
37
37
def isChanging = a.isChanging
@@ -80,11 +80,14 @@ private final class MergedDescriptors(a: DependencyDescriptor, b: DependencyDesc
80
80
arts map { art => explicitConfigurations(base, art) }
81
81
private [this ] def explicitConfigurations (base : DependencyDescriptor , art : DependencyArtifactDescriptor ): DependencyArtifactDescriptor =
82
82
{
83
- val aConfs = art.getConfigurations
84
- if (aConfs == null || aConfs.isEmpty)
85
- copyWithConfigurations(art, base.getModuleConfigurations)
86
- else
87
- art
83
+ val aConfs = Option (art.getConfigurations) map { _.toList }
84
+ // In case configuration list is "*", we should still specify the module configuration of the DependencyDescriptor
85
+ // otherwise the explicit specified artifacts from one dd can leak over to the other.
86
+ // See gh-1500, gh-2002
87
+ aConfs match {
88
+ case None | Some (Nil ) | Some (List (" *" )) => copyWithConfigurations(art, base.getModuleConfigurations)
89
+ case _ => art
90
+ }
88
91
}
89
92
private [this ] def defaultArtifact (a : DependencyDescriptor ): Array [DependencyArtifactDescriptor ] =
90
93
{
0 commit comments