You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2017/02/19 14:13:11 UTC
[9/9] 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.
[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/d2f994d0
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/d2f994d0
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/d2f994d0
Branch: refs/heads/MNG-6170
Commit: d2f994d0cbeb414e6f337bff54a2ce53911efab0
Parents: e6217a4
Author: Karl Heinz Marbaise <kh...@apache.org>
Authored: Sun Feb 12 12:59:25 2017 +0100
Committer: Karl Heinz Marbaise <kh...@apache.org>
Committed: Sun Feb 19 15:05:00 2017 +0100
----------------------------------------------------------------------
apache-maven/pom.xml | 13 +++++++++
.../ConcurrencyDependencyGraph.java | 10 +++----
.../multithreaded/MultiThreadedBuilder.java | 29 +++++++++++---------
3 files changed, 34 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven/blob/d2f994d0/apache-maven/pom.xml
----------------------------------------------------------------------
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index 6fc5a73..5667203 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -178,6 +178,19 @@ under the License.
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>UNKNOWN</phase>
+ <goals>
+ <goal>bundle</goal>
+ <goal>process</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
http://git-wip-us.apache.org/repos/asf/maven/blob/d2f994d0/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java
index 4613165..ded1a92 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java
@@ -1,5 +1,10 @@
package org.apache.maven.lifecycle.internal.builder.multithreaded;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -24,11 +29,6 @@ import org.apache.maven.lifecycle.internal.ProjectBuildList;
import org.apache.maven.lifecycle.internal.ProjectSegment;
import org.apache.maven.project.MavenProject;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
/**
* Presents a view of the Dependency Graph that is suited for concurrent building.
*
http://git-wip-us.apache.org/repos/asf/maven/blob/d2f994d0/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 f0fa2ac..880410e 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
@@ -51,8 +51,7 @@ import org.codehaus.plexus.logging.Logger;
* will always result in a sequential build, regardless of the thread count.
*
* @since 3.0
- * @author Kristian Rosenvold
- * Builds one or more lifecycles for a full module
+ * @author Kristian Rosenvold Builds one or more lifecycles for a full module
* <p/>
* NOTE: This class is not part of any public api and can be changed or deleted without prior notice.
*/
@@ -67,7 +66,6 @@ public class MultiThreadedBuilder
@Requirement
private LifecycleModuleBuilder lifecycleModuleBuilder;
-
public MultiThreadedBuilder()
{
}
@@ -142,15 +140,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 +163,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 )