cstamas commented on code in PR #197:
URL: https://github.com/apache/maven-resolver/pull/197#discussion_r990616953


##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultArtifactResolver.java:
##########
@@ -282,10 +297,31 @@ private List<ArtifactResult> resolve( 
RepositorySystemSession session,
                 continue;
             }
 
+            List<RemoteRepository> remoteRepositories = 
request.getRepositories();
+            List<RemoteRepository> filteredRemoteRepositories = new 
ArrayList<>( remoteRepositories.size() );
+            for ( RemoteRepository repository : remoteRepositories )
+            {
+                RemoteRepositoryFilter.Result filterResult = 
filter.acceptArtifact( repository, artifact );
+                if ( !filterResult.isAccepted() )
+                {
+                    result.addException( new ArtifactNotFoundException( 
artifact, repository,
+                            filterResult.reasoning() ) );
+                }
+                else
+                {
+                    filteredRemoteRepositories.add( repository );
+                }
+            }
+
+            final boolean remoteConsidered = !remoteRepositories.isEmpty();
+            final boolean filteringApplied = remoteConsidered
+                    && !remoteRepositories.equals( filteredRemoteRepositories 
);

Review Comment:
   then `filteringApplied` is `false`?



##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/DefaultMetadataResolver.java:
##########
@@ -226,6 +244,13 @@ private List<MetadataResult> resolve( 
RepositorySystemSession session,
                 continue;
             }
 
+            RemoteRepositoryFilter.Result filterResult = 
remoteRepositoryFilter.acceptMetadata( repository, metadata );
+            if ( !filterResult.isAccepted() )
+            {
+                result.setException( new MetadataNotFoundException( metadata, 
repository, filterResult.reasoning() ) );

Review Comment:
   Same as "see here, and here and here"



-- 
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

Reply via email to