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/01/31 07:48:42 UTC

[GitHub] [maven] laeubi commented on a change in pull request #667: MNG-7400 - Allow more WorkspaceReader's to participate

laeubi commented on a change in pull request #667:
URL: https://github.com/apache/maven/pull/667#discussion_r795408823



##########
File path: maven-core/src/main/java/org/apache/maven/DefaultMaven.java
##########
@@ -367,11 +354,37 @@ private MavenExecutionResult doExecute( MavenExecutionRequest request, MavenSess
         return result;
     }
 
-    private void afterSessionStart( MavenSession session )
+    private void finishRepositorySystemSession( MavenSession session, DefaultRepositorySystemSession repoSession )
+        throws ComponentLookupException
+    {
+        WorkspaceReader reactorWorkspace = container.lookup( WorkspaceReader.class, ReactorReader.HINT );
+        //
+        // Desired order of precedence for local artifact repositories
+        //
+        // Reactor
+        // Workspace
+        // User Local Repository
+        //
+
+        // we only lookup the project scoped ones here, lookup at system level will also find the system components
+        // (like ReactorReader) but that does not work well as these are special handled!
+        for ( WorkspaceReader workspaceReader : getProjectScopedExtensionComponents( session.getProjects(),
+                                                                                     WorkspaceReader.class ) )
+        {
+            repoSession.setWorkspaceReader( ChainedWorkspaceReader.newInstance( repoSession.getWorkspaceReader(),

Review comment:
       Sure that is possible, I just adopted the "style" currently used, but ChainedWorkspaceReader accepts also an array,  I can  adjust ChainedWorkspaceReader to combine if any of the provided ones is already a chained one. Let me know if you think this should be done.




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