Create default artifact for deps from POM files

Dependency descriptors that are created from POM files do not specify
their artifacts. In those cases, it is correct to create a default
artifact.
This commit is contained in:
Martin Duhem 2016-03-14 08:51:25 +01:00
parent fed478cc6b
commit 1e96936c08
1 changed files with 4 additions and 1 deletions

View File

@ -97,7 +97,10 @@ private final class MergedDescriptors(a: DependencyDescriptor, b: DependencyDesc
{
val dd = new DefaultDependencyArtifactDescriptor(a, a.getDependencyRevisionId.getName, "jar", "jar", null, null)
addConfigurations(dd, a.getModuleConfigurations)
a.getAllDependencyArtifacts.filter(_ == dd)
// If the dependency descriptor is empty, then it means that it has been created from a POM file. In this case,
// it is correct to create a seemingly non-existent dependency artifact.
if (a.getAllDependencyArtifacts.isEmpty) Array(dd)
else a.getAllDependencyArtifacts filter (_ == dd)
}
private[this] def copyWithConfigurations(dd: DependencyArtifactDescriptor, confs: Seq[String]): DependencyArtifactDescriptor =
{