Skip to content

Commit

Permalink
[FIXED JENKINS-9072] Incremental builds: Marking modules not being
Browse files Browse the repository at this point in the history
build early, doesn't work with maven 3 projects
  • Loading branch information
kutzi committed Mar 25, 2011
1 parent f423387 commit d882ce5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions maven-plugin/src/main/java/hudson/maven/Maven3Builder.java
Expand Up @@ -42,8 +42,10 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
Expand Down Expand Up @@ -314,6 +316,25 @@ public void projectDiscoveryStarted( ExecutionEvent event ) {
*/
public void sessionStarted( ExecutionEvent event ) {
this.eventLogger.sessionStarted( event );

// set all modules which are not actually being build (in incremental builds) to NOT_BUILD
// JENKINS-9072
List<MavenProject> projects = event.getSession().getProjects();
//maven3Builder.listener.getLogger().println("Projects to build: " + projects);
Set<ModuleName> buildingProjects = new HashSet<ModuleName>();
for (MavenProject p : projects) {
buildingProjects.add(new ModuleName(p));
}

for (Entry<ModuleName,MavenBuildProxy2> e : this.proxies.entrySet()) {
if (! buildingProjects.contains(e.getKey())) {
//maven3Builder.listener.getLogger().println("Project " + e.getKey() + " needs not be build");
MavenBuildProxy2 proxy = e.getValue();
proxy.start();
proxy.setResult(Result.NOT_BUILT);
proxy.end();
}
}
}

/**
Expand Down

0 comments on commit d882ce5

Please sign in to comment.