diff --git a/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java b/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java index d91d43dab2..adfed73704 100644 --- a/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java +++ b/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java @@ -167,8 +167,13 @@ public class DefaultDependencyResolver implements DependencyResolver { InternalSession.from(nonNull(request, "request").getSession()); DependencyResolverResult result; DependencyResolverResult collectorResult = collect(request); - List repositories = - request.getRepositories() != null ? request.getRepositories() : session.getRemoteRepositories(); + List repositories = request.getRepositories() != null + ? request.getRepositories() + : request.getProject().isPresent() + ? session.getService(ProjectManager.class) + .getRemoteProjectRepositories( + request.getProject().get()) + : session.getRemoteRepositories(); if (request.getRequestType() == DependencyResolverRequest.RequestType.COLLECT) { result = collectorResult; } else {