Skip to content

Commit

Permalink
[MNG-8331] Sometimes versioned dependencies disappear
Browse files Browse the repository at this point in the history
Ensure all dependencies end up in the model
  • Loading branch information
jjkester committed Oct 18, 2024
1 parent 912c117 commit 0e4401a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ public void mergeRepositories(List<Repository> toAdd, boolean replace) {
// Infer inner reactor dependencies version
//
Model transformFileToRaw(Model model) {
List<Dependency> newDeps = new ArrayList<>();
boolean modified = false;
List<Dependency> newDeps = new ArrayList<>(model.getDependencies().size());
for (Dependency dep : model.getDependencies()) {
if (dep.getVersion() == null) {
Dependency.Builder depBuilder = null;
Expand All @@ -591,13 +590,14 @@ Model transformFileToRaw(Model model) {
}
if (depBuilder != null) {
newDeps.add(depBuilder.build());
modified = true;
} else {
newDeps.add(dep);
}
} else {
newDeps.add(dep);
}
}
return modified ? model.withDependencies(newDeps) : model;
return model.withDependencies(newDeps);
}

String replaceCiFriendlyVersion(Map<String, String> properties, String version) {
Expand Down

0 comments on commit 0e4401a

Please sign in to comment.