[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()); InternalSession.from(nonNull(request, "request").getSession());
DependencyResolverResult result; DependencyResolverResult result;
DependencyResolverResult collectorResult = collect(request); DependencyResolverResult collectorResult = collect(request);
List<RemoteRepository> repositories = List<RemoteRepository> repositories = request.getRepositories() != null
request.getRepositories() != null ? request.getRepositories() : session.getRemoteRepositories(); ? request.getRepositories()
: request.getProject().isPresent()
? session.getService(ProjectManager.class)
.getRemoteProjectRepositories(
request.getProject().get())
: session.getRemoteRepositories();
if (request.getRequestType() == DependencyResolverRequest.RequestType.COLLECT) { if (request.getRequestType() == DependencyResolverRequest.RequestType.COLLECT) {
result = collectorResult; result = collectorResult;
} else { } else {