Skip to content

Commit

Permalink
[MNG-8331] Mix of the two fixes
Browse files Browse the repository at this point in the history
Don't do anything if not needed.

---

https://issues.apache.org/jira/browse/MNG-8331
  • Loading branch information
cstamas committed Oct 19, 2024
1 parent f4eeca2 commit 565dfb0
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,10 @@ 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;
if (model.getDependencies().isEmpty()) {
return model;
}
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 +593,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 565dfb0

Please sign in to comment.