gnodet commented on code in PR #736: URL: https://github.com/apache/maven/pull/736#discussion_r872493501
########## 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: Right, I'll dig it. -- 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-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org