You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2022/04/27 09:18:15 UTC

[maven] branch MNG-7433-warn-parallel-aggregator created (now 1df04cfef)

This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a change to branch MNG-7433-warn-parallel-aggregator
in repository https://gitbox.apache.org/repos/asf/maven.git


      at 1df04cfef [MNG-7433] Warn if in parallel build aggregator Mojo found

This branch includes the following new commits:

     new 1df04cfef [MNG-7433] Warn if in parallel build aggregator Mojo found

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: [MNG-7433] Warn if in parallel build aggregator Mojo found

Posted by cs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch MNG-7433-warn-parallel-aggregator
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 1df04cfef41393bb0029a465ac0c5e059b7fa526
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Wed Apr 27 11:17:01 2022 +0200

    [MNG-7433] Warn if in parallel build aggregator Mojo found
    
    As aggregator Mojos, as they have access to whole reactor,
    are requiring unique access, hence, they block the parallel
    build, while themselves are executing.
---
 .../org/apache/maven/lifecycle/internal/MojoExecutor.java     | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
index 6c089863c..4edcf6262 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java
@@ -59,6 +59,8 @@ import org.apache.maven.plugin.descriptor.MojoDescriptor;
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.StringUtils;
 import org.eclipse.aether.SessionData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * <p>
@@ -75,10 +77,14 @@ import org.eclipse.aether.SessionData;
 @Singleton
 public class MojoExecutor
 {
+    private static final Logger LOGGER = LoggerFactory.getLogger( MojoExecutor.class );
 
     private final BuildPluginManager pluginManager;
+
     private final MavenPluginManager mavenPluginManager;
+
     private final LifecycleDependencyResolver lifeCycleDependencyResolver;
+
     private final ExecutionEventCatapult eventCatapult;
 
     private final ReadWriteLock aggregatorLock = new ReentrantReadWriteLock();
@@ -223,6 +229,11 @@ public class MojoExecutor
             }
         }
 
+        if ( session.isParallel() && mojoDescriptor.isAggregator() )
+        {
+            LOGGER.warn( "Now what?" );
+        }
+
         try ( ProjectLock lock = new ProjectLock( session, mojoDescriptor, aggregatorLock ) )
         {
             doExecute( session, mojoExecution, projectIndex, dependencyContext );