juulhobert commented on code in PR #603: URL: https://github.com/apache/maven/pull/603#discussion_r1562205753
########## maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java: ########## @@ -1683,13 +1684,20 @@ private void importDependencyManagement( it.remove(); + // Model v3 DependencyManagement importMgmt = loadDependencyManagement(model, request, problems, dependency, importIds); + if (importMgmt == null) { + continue; + } - if (importMgmt != null) { - if (importMgmts == null) { - importMgmts = new ArrayList<>(); - } - + if (request.isLocationTracking()) { + // Keep track of why this DependencyManagement was imported. + // And map model v3 to model v4 -> importMgmt(v3).getDelegate() returns a v4 object + importMgmts.add( + org.apache.maven.api.model.DependencyManagement.newBuilder(importMgmt.getDelegate(), true) + .importedFrom(dependency.getDelegate().getLocation("")) Review Comment: @hboutemy you're right. It should only map it from model v3 to model v4. We're going to remove the line `.importedFrom(dependency.getDelegate().getLocation(""))` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org