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

ASF GitHub Bot commented on MNG-8005:
-------------------------------------

cstamas commented on code in PR #1385:
URL: https://github.com/apache/maven/pull/1385#discussion_r1457256038


##########
maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java:
##########
@@ -77,24 +79,29 @@ public class BootstrapCoreExtensionManager {
 
     private final ClassRealm parentRealm;
 
+    private final WorkspaceReader ideWorkspaceReader;
+
     @Inject
     public BootstrapCoreExtensionManager(
             DefaultPluginDependenciesResolver pluginDependenciesResolver,
             DefaultRepositorySystemSessionFactory 
repositorySystemSessionFactory,
             CoreExports coreExports,
-            PlexusContainer container) {
+            PlexusContainer container,
+            @Nullable @Named("ide") WorkspaceReader ideWorkspaceReader) {
         this.pluginDependenciesResolver = pluginDependenciesResolver;
         this.repositorySystemSessionFactory = repositorySystemSessionFactory;
         this.coreExports = coreExports;
         this.classWorld = ((DefaultPlexusContainer) container).getClassWorld();
         this.parentRealm = container.getContainerRealm();
+        this.ideWorkspaceReader = ideWorkspaceReader;
     }
 
     public List<CoreExtensionEntry> loadCoreExtensions(
             MavenExecutionRequest request, Set<String> providedArtifacts, 
List<CoreExtension> extensions)
             throws Exception {
         try (CloseableSession repoSession = repositorySystemSessionFactory
                 .newRepositorySessionBuilder(request)
+                .setWorkspaceReader(ideWorkspaceReader)

Review Comment:
   Fixed.
   
   But your comment is wrong: session factory _never used_ chained WSReader, it 
was ONLY the default maven using it. Before this PR, the session could be 
inited with request WS (if non null) OR the ide WS (that may be null).





> IDE WorkspaceReader is ignored in Maven 4
> -----------------------------------------
>
>                 Key: MNG-8005
>                 URL: https://issues.apache.org/jira/browse/MNG-8005
>             Project: Maven
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 4.0.0-alpha-4, 4.0.0-alpha-10
>            Reporter: Jonas Rutishauser
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 4.0.0, 4.0.0-alpha-13
>
>
> Since maven-4.0.0-alpha-4 the {{@Named("ide") WorkspaceReader}} (and the one 
> from the {{MavenExecutionRequest}}) is no longer used.
> The [last 
> commit|https://github.com/apache/maven/commit/f77de570b789d6e0c48c7d5001fdb4d9f663187c]
>  of MNG-7646 introduced this bug.



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

Reply via email to