[MSHADE-467] Fix concurrency problem with dependency-reduced POM by kriegaex · Pull Request #210 · apache/maven-shade-plugin (original) (raw)

@kriegaex

@kriegaex

It looks as if running MShade concurrently somehow bleeds MavenSession state into other mojo executions. Therefore, in the lower critical section of ShadeMojo::rewriteDependencyReducedPomIfWeHaveReduction, we use a final static ReentrantLock instance to block concurrent entry to the section.

rmannibucau

@kriegaex @rmannibucau

Code review: Synchronising on session.getProjectBuildingRequest() is less invasive than a global reentrant lock and therefore preferable to the reviewer.

Co-authored-by: Romain Manni-Bucau rmannibucau@gmail.com

@olamy olamy added the bug

Something isn't working

label

Sep 9, 2025

This file contains hidden or 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

[ Show hidden characters]({{ revealButtonHref }})