Provide group in ResolvedArtifactLibrary to enable discrimination

The fix for gh-1475 introduced the use of an artifact's group to
discriminate between two libraries with the same name (artifact id)
and version. However, in the case of Gradle, a group name was not
provided for libraries that have been resolved from a repository.

This commit updates ResolvedArtifactLibrary to use the group obtained
from the underlying ResolvedArtifact as its discriminator.

Fixes gh-1543
This commit is contained in:
Andy Wilkinson 2014-09-15 15:40:29 +01:00
parent 6456f2a542
commit 3c815f4014
1 changed files with 2 additions and 1 deletions

View File

@ -209,7 +209,8 @@ class ProjectLibraries implements Libraries {
private final ResolvedArtifact artifact;
public ResolvedArtifactLibrary(ResolvedArtifact artifact, LibraryScope scope) {
super(null, artifact.getFile(), scope);
super(artifact.getModuleVersion().getId().getGroup(), artifact.getFile(),
scope);
this.artifact = artifact;
}