maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From khmarba...@apache.org
Subject [1/4] maven git commit: [MNG-6170] NPE in cases using Multithreaded -T X versions:set -DnewVersion=1.0-SNAPSHOT o In some cases the code will return a null which should not be scheduled. [Forced Update!]
Date Sat, 11 Mar 2017 17:46:15 GMT
Repository: maven
Updated Branches:
  refs/heads/MNG-6057 d45c316b1 -> 9d1fce536 (forced update)


[MNG-6170] NPE in cases using Multithreaded -T X versions:set
-DnewVersion=1.0-SNAPSHOT
 o In some cases the code will return a null which should
   not be scheduled.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/7cdff43a
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/7cdff43a
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/7cdff43a

Branch: refs/heads/MNG-6057
Commit: 7cdff43aba436408c79d2b4afc169b9c6909235a
Parents: 587317b
Author: Karl Heinz Marbaise <khmarbaise@apache.org>
Authored: Sun Feb 12 12:59:25 2017 +0100
Committer: Karl Heinz Marbaise <khmarbaise@apache.org>
Committed: Sat Mar 11 12:00:24 2017 +0100

----------------------------------------------------------------------
 .../multithreaded/MultiThreadedBuilder.java     | 27 ++++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/7cdff43a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
index 072aec8..1414a12 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/MultiThreadedBuilder.java
@@ -55,6 +55,7 @@ import org.codehaus.plexus.logging.Logger;
  * @since 3.0
  * @author Kristian Rosenvold
  *         Builds one or more lifecycles for a full module
+ *         NOTE: This class is not part of any public api and can be changed or deleted without
prior notice.
  */
 @Component( role = Builder.class, hint = "multithreaded" )
 public class MultiThreadedBuilder
@@ -67,7 +68,6 @@ public class MultiThreadedBuilder
     @Requirement
     private LifecycleModuleBuilder lifecycleModuleBuilder;
 
-
     public MultiThreadedBuilder()
     {
     }
@@ -142,15 +142,20 @@ public class MultiThreadedBuilder
                 {
                     break;
                 }
-                final List<MavenProject> newItemsThatCanBeBuilt =
-                    analyzer.markAsFinished( projectBuild.getProject() );
-                for ( MavenProject mavenProject : newItemsThatCanBeBuilt )
+
+                // MNG-6170: Only schedule other modules from reactor if we have more modules
to build than one. 
+                if ( analyzer.getNumberOfBuilds() > 1 )
                 {
-                    ProjectSegment scheduledDependent = projectBuildList.get( mavenProject
);
-                    logger.debug( "Scheduling: " + scheduledDependent );
-                    Callable<ProjectSegment> cb =
-                        createBuildCallable( rootSession, scheduledDependent, reactorContext,
taskSegment, muxer );
-                    service.submit( cb );
+                    final List<MavenProject> newItemsThatCanBeBuilt =
+                        analyzer.markAsFinished( projectBuild.getProject() );
+                    for ( MavenProject mavenProject : newItemsThatCanBeBuilt )
+                    {
+                        ProjectSegment scheduledDependent = projectBuildList.get( mavenProject
);
+                        logger.debug( "Scheduling: " + scheduledDependent );
+                        Callable<ProjectSegment> cb =
+                            createBuildCallable( rootSession, scheduledDependent, reactorContext,
taskSegment, muxer );
+                        service.submit( cb );
+                    }
                 }
             }
             catch ( InterruptedException e )
@@ -160,13 +165,13 @@ public class MultiThreadedBuilder
             }
             catch ( ExecutionException e )
             {
-                // TODO MNG-5766 changes likely made this redundant 
+                // TODO MNG-5766 changes likely made this redundant
                 rootSession.getResult().addException( e );
                 break;
             }
         }
 
-        // cancel outstanding builds (if any)  - this can happen if an exception is thrown
in above block
+        // cancel outstanding builds (if any) - this can happen if an exception is thrown
in above block
 
         Future<ProjectSegment> unprocessed;
         while ( ( unprocessed = service.poll() ) != null )


Mime
View raw message