Make sure the daemon system properties are reset after a build, fixes #5

This commit is contained in:
Guillaume Nodet
2019-10-01 14:54:45 +02:00
parent af50993285
commit 9eeceef158

View File

@@ -159,6 +159,7 @@ public class DaemonMavenCli
// TODO need to externalize CliRequest // TODO need to externalize CliRequest
public int doMain(CliRequest cliRequest) throws Exception public int doMain(CliRequest cliRequest) throws Exception
{ {
Properties props = (Properties) System.getProperties().clone();
try { try {
initialize(cliRequest); initialize(cliRequest);
cli(cliRequest); cli(cliRequest);
@@ -176,25 +177,9 @@ public class DaemonMavenCli
{ {
return e.exitCode; return e.exitCode;
} }
// catch ( UnrecognizedOptionException e )
// {
// pure user error, suppress stack trace
// return 1;
// }
// catch ( BuildAbort e )
// {
// CLIReportingUtils.showError( slf4jLogger, "ABORTED", e, cliRequest.showErrors );
//
// return 2;
// }
// catch ( Exception e )
// {
// CLIReportingUtils.showError( slf4jLogger, "Error executing Maven.", e, cliRequest.showErrors );
//
// return 1;
// }
finally finally
{ {
System.setProperties(props);
eventSpyDispatcher.close(); eventSpyDispatcher.close();
} }
} }