private RunProcess runProcess(List<String> args) throws MojoExecutionException { try { RunProcess runProcess = new RunProcess(new JavaExecutable().toString()); runProcess.run(false, args.toArray(new String[args.size()])); return runProcess; } catch (Exception ex) { throw new MojoExecutionException("Could not exec java", ex); } }
@Override protected void runWithForkedJvm(List<String> args) throws MojoExecutionException, MojoFailureException { RunProcess runProcess = runProcess(args); try { waitForSpringApplication(); } catch (MojoExecutionException ex) { runProcess.kill(); throw ex; } catch (MojoFailureException ex) { runProcess.kill(); throw ex; } }