List of usage examples for org.springframework.ide.eclipse.boot.util DumpOutput DumpOutput
public DumpOutput(String streamName)
From source file:org.springframework.ide.eclipse.boot.core.internal.MavenSpringBootProject.java
@Override public File executePackagingScript(IProgressMonitor monitor) throws CoreException { monitor.beginTask("Building War file", 100); try {/*from w w w . j a v a2s . co m*/ ILaunchConfiguration launchConf = createLaunchConfiguration(project, "package"); ILaunch launch = launchConf.launch(MVN_LAUNCH_MODE, SubMonitor.convert(monitor, 10), true, true); if (DUMP_MAVEN_OUTPUT) { launch.getProcesses()[0].getStreamsProxy().getOutputStreamMonitor() .addListener(new DumpOutput("%mvn-out")); launch.getProcesses()[0].getStreamsProxy().getErrorStreamMonitor() .addListener(new DumpOutput("%mvn-err")); } LaunchUtils.whenTerminated(launch).get(); int exitValue = launch.getProcesses()[0].getExitValue(); if (exitValue != 0) { throw ExceptionUtil.coreException("Non-zero exit-code(" + exitValue + ") from maven war packaging. Check maven console for errors!"); } return findWarFile(); } catch (ExecutionException | InterruptedException e) { throw ExceptionUtil.coreException(e); } finally { monitor.done(); } }