Skip to content

Commit

Permalink
Experiment: leave out dep from depMgmt
Browse files Browse the repository at this point in the history
As dep is "stronger" anyway, on conflict resolution will
win.
  • Loading branch information
cstamas committed Jul 11, 2024
1 parent e7e0cbb commit 924691c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -56,14 +57,18 @@ public void populateResult(RepositorySystemSession session, ArtifactDescriptorRe
result.addRepository(ArtifactDescriptorUtils.toRemoteRepository(r));
}

HashSet<String> dependencyKeys = new HashSet<>(model.getDependencies().size());
for (org.apache.maven.model.Dependency dependency : model.getDependencies()) {
result.addDependency(convert(dependency, stereotypes));
dependencyKeys.add(dependency.getManagementKey());
}

DependencyManagement mgmt = model.getDependencyManagement();
if (mgmt != null) {
for (org.apache.maven.model.Dependency dependency : mgmt.getDependencies()) {
result.addManagedDependency(convert(dependency, stereotypes));
if (!dependencyKeys.contains(dependency.getManagementKey())) {
result.addManagedDependency(convert(dependency, stereotypes));
}
}
}

Expand Down

0 comments on commit 924691c

Please sign in to comment.