-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MNG-7402] BuildListCalculator never detaches the classloader
This closes #683
- Loading branch information
Showing
1 changed file
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,10 +57,18 @@ public ProjectBuildList calculateProjectBuilds( MavenSession session, List<TaskS | |
} | ||
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 ) ); | ||
ClassLoader tccl = Thread.currentThread().getContextClassLoader(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
michael-o
Member
|
||
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 ) ); | ||
} | ||
finally | ||
{ | ||
Thread.currentThread().setContextClassLoader( tccl ); | ||
} | ||
} | ||
} | ||
return new ProjectBuildList( projectBuilds ); | ||
|
The call to get the
tccl
could have been moved outside the loop.