Skip to content

Commit

Permalink
Jar-in-Jar: Fix specified version range being ignored (#32)
Browse files Browse the repository at this point in the history
The range in the JiJ metadata was currently always based on the actual
artifact version.
  • Loading branch information
shartte authored Jun 16, 2024
1 parent 5acdebf commit 1fb37a7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,8 @@ private static List<ResolvedJarJarArtifact> getIncludedJars(Set<ResolvedComponen
continue;
}

String version = getVersionFrom(variant);

String versionRange = makeOpenRange(variant);
String version = versions.getOrDefault(jarIdentifier, getVersionFrom(variant));
String versionRange = versionRanges.getOrDefault(jarIdentifier, makeOpenRange(variant));

if (version != null && versionRange != null) {
var embeddedFilename = getEmbeddedFilename(result, jarIdentifier);
Expand Down Expand Up @@ -237,5 +236,6 @@ private static boolean isValidVersionRange(final @Nullable String range) {
/**
* Simple artifact identifier class which only references group, name and version.
*/
private record ArtifactIdentifier(String group, String name, String version) {}
private record ArtifactIdentifier(String group, String name, String version) {
}
}

0 comments on commit 1fb37a7

Please sign in to comment.