use of org.apache.maven.shared.invoker.PrintStreamLogger in project syncope by apache.
the class MavenUtils method invoke.
private InvocationResult invoke(final InvocationRequest request, final String path) {
InvocationResult result = null;
final Invoker invoker = new DefaultInvoker();
try {
invoker.setLogger(new PrintStreamLogger(new PrintStream(InstallLog.getInstance().getFileAbsolutePath()), 1000));
invoker.setOutputHandler(new PrintStreamHandler(new PrintStream(InstallLog.getInstance().getFileAbsolutePath()), true));
invoker.setWorkingDirectory(new File(path));
result = invoker.execute(request);
} catch (MavenInvocationException | FileNotFoundException ex) {
final String messageError = "Maven exception: " + ex.getMessage();
handler.emitError(messageError, messageError);
InstallLog.getInstance().info(messageError);
}
return result;
}
Aggregations