diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java index b04b2db2b..08bf531e7 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java @@ -575,20 +575,6 @@ private void performDownloads( RepositorySystemSession session, ResolutionGroup try { - RemoteRepository repo = group.repository; - if ( repo.isBlocked() ) - { - if ( repo.getMirroredRepositories().isEmpty() ) - { - throw new NoRepositoryConnectorException( repo, "Blocked repository: " + repo ); - } - else - { - throw new NoRepositoryConnectorException( repo, "Blocked mirror for repositories: " - + repo.getMirroredRepositories() ); - } - } - try ( RepositoryConnector connector = repositoryConnectorProvider.newRepositoryConnector( session, group.repository ) ) { diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java index 976ccd82f..c148983c6 100644 --- a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java +++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultRepositoryConnectorProvider.java @@ -109,6 +109,20 @@ public RepositoryConnector newRepositoryConnector( RepositorySystemSession sessi throws NoRepositoryConnectorException { requireNonNull( repository, "remote repository cannot be null" ); + + if ( repository.isBlocked() ) + { + if ( repository.getMirroredRepositories().isEmpty() ) + { + throw new NoRepositoryConnectorException( repository, "Blocked repository: " + repository ); + } + else + { + throw new NoRepositoryConnectorException( repository, "Blocked mirror for repositories: " + + repository.getMirroredRepositories() ); + } + } + RemoteRepositoryFilter filter = remoteRepositoryFilterManager.getRemoteRepositoryFilter( session ); PrioritizedComponents factories = new PrioritizedComponents<>( session );