[MNG-8368] Fix dependency resolver not using project repositories (#1865)

This commit is contained in:
Guillaume Nodet 2024-11-05 17:01:08 +01:00 committed by GitHub
parent 51123f3abc
commit 62c94d123c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -167,8 +167,13 @@ public class DefaultDependencyResolver implements DependencyResolver {
InternalSession.from(nonNull(request, "request").getSession());
DependencyResolverResult result;
DependencyResolverResult collectorResult = collect(request);
List<RemoteRepository> repositories =
request.getRepositories() != null ? request.getRepositories() : session.getRemoteRepositories();
List<RemoteRepository> 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 {