Skip to content

Commit

Permalink
MNG-7402 - BuildListCalculator never detaches the classloader
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Läubrich committed Feb 25, 2022
1 parent 395411f commit 738b44a
Showing 1 changed file with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
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 ) );
}
}
finally
{
Thread.currentThread().setContextClassLoader( ccl );
}
}
return new ProjectBuildList( projectBuilds );
Expand Down

0 comments on commit 738b44a

Please sign in to comment.