Skip to content

Commit 3c815f4

Browse files
committed
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
1 parent 6456f2a commit 3c815f4

File tree

1 file changed

+2
-1
lines changed
  • spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage

1 file changed

+2
-1
lines changed

spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ private class ResolvedArtifactLibrary extends GradleLibrary {
209209
private final ResolvedArtifact artifact;
210210

211211
public ResolvedArtifactLibrary(ResolvedArtifact artifact, LibraryScope scope) {
212-
super(null, artifact.getFile(), scope);
212+
super(artifact.getModuleVersion().getId().getGroup(), artifact.getFile(),
213+
scope);
213214
this.artifact = artifact;
214215
}
215216

0 commit comments

Comments
 (0)