You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/10/08 08:35:45 UTC

[GitHub] [maven-resolver] michael-o commented on a diff in pull request #197: [MRESOLVER-274] Remote Repository Filter

michael-o commented on code in PR #197:
URL: https://github.com/apache/maven-resolver/pull/197#discussion_r990611849


##########
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() ) );

Review Comment:
   Is this really worth an exception? I mean if I know that my repo will only serve `com.example` it is not an error to skip `org` for reason.



-- 
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-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org