mirror of https://github.com/sbt/sbt.git
Check that default artifact exists when trying to retrieve it.
When concatenating the artifacts coming from two modules, we sometimes attempted to create a default artifact from the organization and name of the module. However, this may fail because a module a % b "1.0" may not have an artifact named "b.jar" (see sbt/sbt#2431). Fixes sbt/sbt#2431.
This commit is contained in:
parent
d304a95b24
commit
bd082a562b
|
|
@ -79,8 +79,8 @@ private final class MergedDescriptors(a: DependencyDescriptor, b: DependencyDesc
|
|||
{
|
||||
if (as.isEmpty)
|
||||
if (bs.isEmpty) as
|
||||
else defaultArtifact(a) +: explicitConfigurations(b, bs)
|
||||
else if (bs.isEmpty) explicitConfigurations(a, as) :+ defaultArtifact(b)
|
||||
else defaultArtifact(a) ++ explicitConfigurations(b, bs)
|
||||
else if (bs.isEmpty) explicitConfigurations(a, as) ++ defaultArtifact(b)
|
||||
else concat(explicitConfigurations(a, as), explicitConfigurations(b, bs))
|
||||
}
|
||||
private[this] def explicitConfigurations(base: DependencyDescriptor, arts: Array[DependencyArtifactDescriptor]): Array[DependencyArtifactDescriptor] =
|
||||
|
|
@ -93,11 +93,11 @@ private final class MergedDescriptors(a: DependencyDescriptor, b: DependencyDesc
|
|||
else
|
||||
art
|
||||
}
|
||||
private[this] def defaultArtifact(a: DependencyDescriptor): DependencyArtifactDescriptor =
|
||||
private[this] def defaultArtifact(a: DependencyDescriptor): Array[DependencyArtifactDescriptor] =
|
||||
{
|
||||
val dd = new DefaultDependencyArtifactDescriptor(a, a.getDependencyRevisionId.getName, "jar", "jar", null, null)
|
||||
addConfigurations(dd, a.getModuleConfigurations)
|
||||
dd
|
||||
a.getAllDependencyArtifacts.filter(_ == dd)
|
||||
}
|
||||
private[this] def copyWithConfigurations(dd: DependencyArtifactDescriptor, confs: Seq[String]): DependencyArtifactDescriptor =
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue