use of org.apache.maven.BuildAbort in project kie-wb-common by kiegroup.
the class AFMavenCli method doMain.
public int doMain(AFCliRequest cliRequest, ClassWorld classWorld) {
PlexusContainer localContainer = null;
try {
initialize(cliRequest);
cli(cliRequest);
logging(cliRequest);
version(cliRequest);
properties(cliRequest);
localContainer = container(cliRequest, classWorld);
commands(cliRequest);
configure(cliRequest);
toolchains(cliRequest);
populateRequest(cliRequest);
repository(cliRequest);
return execute(cliRequest);
} catch (ExitException e) {
e.getStackTrace();
return e.exitCode;
} catch (UnrecognizedOptionException e) {
e.getStackTrace();
return 1;
} catch (BuildAbort e) {
e.getStackTrace();
AFCLIReportingUtils.showError(slf4jLogger, "ABORTED", e, cliRequest.isShowErrors());
return 2;
} catch (Exception e) {
e.getStackTrace();
AFCLIReportingUtils.showError(slf4jLogger, "Error executing Maven.", e, cliRequest.isShowErrors());
return 1;
} finally {
if (localContainer != null) {
localContainer.dispose();
localContainer = null;
}
}
}
use of org.apache.maven.BuildAbort in project kie-wb-common by kiegroup.
the class AFMavenCli method doMain.
public int doMain(AFCliRequest cliRequest, ClassWorld classWorld) {
PlexusContainer localContainer = null;
PrintStream originalOut = System.out;
PrintStream originalErr = System.err;
try {
initialize(cliRequest);
cli(cliRequest);
logging(cliRequest);
version(cliRequest);
properties(cliRequest);
localContainer = container(cliRequest, classWorld);
commands(cliRequest);
configure(cliRequest);
toolchains(cliRequest);
populateRequest(cliRequest);
repository(cliRequest);
return execute(cliRequest);
} catch (ExitException e) {
e.getStackTrace();
return e.exitCode;
} catch (UnrecognizedOptionException e) {
e.getStackTrace();
return 1;
} catch (BuildAbort e) {
e.getStackTrace();
AFCLIReportingUtils.showError(slf4jLogger, "ABORTED", e, cliRequest.isShowErrors());
return 2;
} catch (Exception e) {
e.getStackTrace();
AFCLIReportingUtils.showError(slf4jLogger, "Error executing Maven.", e, cliRequest.isShowErrors());
return 1;
} finally {
System.setOut(originalOut);
System.setErr(originalErr);
if (localContainer != null) {
localContainer.dispose();
localContainer = null;
}
}
}
use of org.apache.maven.BuildAbort in project kie-wb-common by kiegroup.
the class ReusableAFMavenCli method doMain.
public int doMain(AFCliRequest cliRequest, ClassWorld classWorld) {
PrintStream originalOut = System.out;
PrintStream originalErr = System.err;
try {
initialize(cliRequest);
cli(cliRequest);
logging(cliRequest);
version(cliRequest);
properties(cliRequest);
reusableContainer = container(cliRequest, classWorld);
// ok
commands(cliRequest);
configure(cliRequest);
toolchains(cliRequest);
populateRequest(cliRequest);
repository(cliRequest);
return execute(cliRequest);
} catch (ExitException e) {
// e.printStackTrace();
e.getStackTrace();
return e.exitCode;
} catch (UnrecognizedOptionException e) {
// e.printStackTrace();
e.getStackTrace();
return 1;
} catch (BuildAbort e) {
// e.printStackTrace();
e.getStackTrace();
AFCLIReportingUtils.showError(reusableSlf4jLogger, "ABORTED", e, cliRequest.isShowErrors());
return 2;
} catch (Exception e) {
// e.printStackTrace();
e.getStackTrace();
AFCLIReportingUtils.showError(reusableSlf4jLogger, "Error executing Maven.", e, cliRequest.isShowErrors());
return 1;
} finally {
System.setOut(originalOut);
System.setErr(originalErr);
}
}
Aggregations