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/02/26 10:38:44 UTC

[GitHub] [maven] laeubi commented on a change in pull request #683: MNG-7402 - BuildListCalculator never detaches the classloader

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



##########
File path: maven-core/src/main/java/org/apache/maven/lifecycle/internal/BuildListCalculator.java
##########
@@ -55,12 +55,20 @@ public ProjectBuildList calculateProjectBuilds( MavenSession session, List<TaskS
             {
                 projects = session.getProjects();
             }
-            for ( MavenProject project : projects )
+            ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+            try
             {
-                BuilderCommon.attachToThread( project ); // Not totally sure if this is needed for anything
-                MavenSession copiedSession = session.clone();
-                copiedSession.setCurrentProject( project );
-                projectBuilds.add( new ProjectSegment( project, taskSegment, copiedSession ) );
+                for ( MavenProject project : projects )

Review comment:
       I'll check this, you are probably right that there is a small chance that a project has not a custom classloader..




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