提交 34a38180 编写于 作者: K kohsuke

E-mail notificaitons were not working with aggregator-style Maven2 builds.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4753 71c3de6d-444a-0410-be80-ed276b4c234a
上级 fa2fe21b
......@@ -257,6 +257,9 @@ public class MavenBuild extends AbstractBuild<MavenModule,MavenBuild> {
}
}
/**
* Sends the accumuldated log in {@link SplittableBuildListener} to the log of this build.
*/
public void appendLastLog() {
try {
listener.setSideOutputStream(log);
......@@ -301,6 +304,8 @@ public class MavenBuild extends AbstractBuild<MavenModule,MavenBuild> {
private Object writeReplace() {
return Channel.current().export(MavenBuildProxy2.class,this);
}
}
private class RunnerImpl extends AbstractRunner {
......
package hudson.maven;
import hudson.AbortException;
import hudson.Launcher;
import hudson.maven.MavenBuild.ProxyImpl2;
import hudson.FilePath.FileCallable;
import hudson.model.AbstractBuild;
......@@ -303,12 +304,11 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
margs.add("-B").add("-f",project.getModuleRoot().child(project.getRootPOM()).getRemote());
margs.addTokenized(project.getGoals());
Builder builder = new Builder(slistener, proxies, project.sortedActiveModules, margs.toList(), envVars);
try {
return process.channel.call(new Builder(
slistener,proxies,project.sortedActiveModules,margs.toList(),envVars));
return process.channel.call(builder);
} finally {
for (ProxyImpl2 p : proxies.values())
p.close();
builder.end(launcher);
process.discard();
}
}
......@@ -366,6 +366,22 @@ public final class MavenModuleSetBuild extends AbstractBuild<MavenModuleSet,Mave
reporters.put(m.getModuleName(),m.createReporters());
}
/**
* Invoked after the maven has finished running, and in the master, not in the maven process.
*/
void end(Launcher launcher) throws IOException, InterruptedException {
for (Map.Entry<ModuleName,? extends MavenBuildProxy2> e : proxies.entrySet()) {
ProxyImpl2 p = (ProxyImpl2) e.getValue();
for (MavenReporter r : reporters.get(e.getKey())) {
// we'd loe to do this when the module build ends, but do so requires
// we know how many task segments are in the current build.
r.end(p.owner(),launcher,listener);
p.appendLastLog();
}
p.close();
}
}
public Result call() throws IOException {
try {
return super.call();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册