String (String... command) { try { GeneralCommandLine cmd = new GeneralCommandLine(command).withRedirectErrorStream(true); ProcessOutput output = ExecUtil.execAndGetOutput(cmd, 30_000); String out = output.getStdout().trim(); if (output.getExitCode() != 0) { fail("failed: " + cmd + "\n" + "exit code: " + output.getExitCode() + "; output:\n" + out); } return out; } catch (ExecutionException e) { throw new RuntimeException(e); } }