"Encountered an IO exception while attempting to execute Maven."
+ " CruiseControl cannot continue.",
e);
}
StreamPumper errorPumper = new StreamPumper(p.getErrorStream(), this);
StreamPumper outPumper = new StreamPumper(p.getInputStream(), this);
Thread errorPumperThread = new Thread(errorPumper);
Thread outPumperThread = new Thread(outPumper);
errorPumperThread.start();
outPumperThread.start();
int exitCode = 1;
try {
exitCode = p.waitFor();
errorPumperThread.join();
outPumperThread.join();
p.getInputStream().close();
p.getOutputStream().close();
p.getErrorStream().close();
} catch (InterruptedException e) {
LOG.info(
"Was interrupted while waiting for Maven to finish."
+ " CruiseControl will continue, assuming that it completed");
} catch (IOException ie) {
LOG.info("Exception trying to close Process streams.", ie);
}
outPumper.flush();
errorPumper.flush();
flushCurrentElement();
// The maven.bat actually never returns error,
// due to internal cleanup called after the execution itself...