From 3c815f4014e47c98e53e565e77794c08d405d9a6 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 15 Sep 2014 15:40:29 +0100 Subject: [PATCH] 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 --- .../boot/gradle/repackage/ProjectLibraries.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java index 90e673df63..1a3e28e1b1 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java @@ -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; }