gnodet commented on code in PR #736:
URL: https://github.com/apache/maven/pull/736#discussion_r872522599
##########
maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java:
##########
@@ -232,7 +237,17 @@ private static class ProjectLock implements AutoCloseable
boolean aggregator = mojoDescriptor.isAggregator();
acquiredAggregatorLock = aggregator ?
aggregatorLock.writeLock() : aggregatorLock.readLock();
acquiredProjectLock = getProjectLock( session );
- acquiredAggregatorLock.lock();
+ if ( !acquiredAggregatorLock.tryLock() )
+ {
+ for ( String s : MessageHelper.formatWarning(
+ "An aggregator Mojo is already executing in
parallel build, but aggregator "
+ + "Mojos require exclusive access to
reactor to prevent race conditions. This "
+ + "mojo execution will be blocked until
the aggregator work is done." ) )
+ {
Review Comment:
Found it. But that makes me wonder if we should display some more detailed
infos about the aggregator mojo. It may not be trivial to find it in the whole
build. Thoughts ?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]