[ 
https://issues.apache.org/jira/browse/MRESOLVER-276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17614909#comment-17614909
 ] 

ASF GitHub Bot commented on MRESOLVER-276:
------------------------------------------

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


##########
maven-resolver-spi/src/main/java/org/eclipse/aether/spi/resolution/ArtifactResolverPostProcessor.java:
##########
@@ -0,0 +1,63 @@
+package org.eclipse.aether.spi.resolution;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.List;
+
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.resolution.ArtifactResult;
+
+/**
+ * Artifact resolver post-resolution processor component, is able to hook into 
resolver and post-process the resolved
+ * artifact results, if needed even produce resolution failure. It will always 
be invoked (even when failure is about
+ * to happen), so detecting these cases are left to post processor 
implementations.
+ *
+ * @since TBD
+ */
+public interface ArtifactResolverPostProcessor
+{
+    /**
+     * Enum representing post-processing outcome.
+     */
+    enum Outcome
+    {
+        /**
+         * Post-processing was ok, continue.
+         */
+        CONTINUE,

Review Comment:
   originally I had `boolean` instead of this enum, but it made reading the 
source cumbersome (true = failed or true=passed?), so I just added this enum to 
clarity sake. Other option is to move whole post-processing BEFORE 
org/eclipse/aether/internal/impl/DefaultArtifactResolver.java#428... as post 
processor 'unresolve" (and adds exception to result), so actually this is what 
am gonna do. Then no need for return value at all, as post processor 
"communicates" via passed in result states (which is the case even now),





> Resolver post-processor
> -----------------------
>
>                 Key: MRESOLVER-276
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-276
>             Project: Maven Resolver
>          Issue Type: Improvement
>          Components: Resolver
>            Reporter: Tamas Cservenak
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: resolver-next
>
>
> Introduce new feature, resolver post-processor that is able to post process 
> resolution results just before artifact resolver returns them to caller. Post 
> processor should be able to signal resolution failure (along with errors) 
> just like existing resolution may fail.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to