Skip to content

Commit

Permalink
Resolve dependency version after type and classifier
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Nov 18, 2023
1 parent eee01dd commit 18afc43
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -769,15 +769,6 @@ private Dependency getValues(Dependency dep, int depth) {
return d;
}

String version = d.getVersion();
if (d.getVersion() == null || depth > 0) {
// dependency management overrides transitive dependency versions
version = getManagedVersion(d.getGroupId(), d.getArtifactId(), d.getType(), d.getClassifier());
if (version == null) {
version = d.getVersion();
}
}

String scope;
if (d.getScope() == null) {
Scope parsedScope = getManagedScope(d.getGroupId(), d.getArtifactId(), d.getType(), d.getClassifier());
Expand All @@ -797,6 +788,15 @@ private Dependency getValues(Dependency dep, int depth) {
if (d.getType() != null) {
d = d.withType(getValue(d.getType()));
}
String version = d.getVersion();
if (d.getVersion() == null || depth > 0) {
// dependency management overrides transitive dependency versions
version = getManagedVersion(d.getGroupId(), d.getArtifactId(), d.getType(), d.getClassifier());
if (version == null) {
version = d.getVersion();
}
}

return d
.withGav(d.getGav().withVersion(version))
.withScope(scope);
Expand Down

0 comments on commit 18afc43

Please sign in to comment.