public final void execute(String args, Map<String, String> environment) throws TaskRunnerException {
final String absoluteTaskLocation = getAbsoluteTaskLocation();
final List<String> arguments = getArguments(args);
logger.info("Running " + taskToString(taskName, arguments) + " in " + config.getWorkingDirectory());
try {
final int result = new NodeExecutor(config, prepend(absoluteTaskLocation, arguments), environment).executeAndRedirectOutput(logger);
if (result != 0) {
throw new TaskRunnerException(taskToString(taskName, arguments) + " failed. (error code " + result + ")");
}
} catch (ProcessExecutionException e) {
throw new TaskRunnerException(taskToString(taskName, arguments) + " failed.", e);
}
}