Skip to content

Commit

Permalink
Update RunMojo to fail when forked JVM returned non-zero exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Jun 16, 2016
1 parent 159ef8f commit ec7d638
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ public class RunMojo extends AbstractRunMojo {
@Override
protected void runWithForkedJvm(List<String> args) throws MojoExecutionException {
try {
new RunProcess(new JavaExecutable().toString()).run(true,
int exitCode = new RunProcess(new JavaExecutable().toString()).run(true,
args.toArray(new String[args.size()]));
if (exitCode != 0) {
throw new MojoExecutionException(
"Application finished with non-zero exit code: " + exitCode);
}
}
catch (Exception ex) {
throw new MojoExecutionException("Could not exec java", ex);
Expand Down

0 comments on commit ec7d638

Please sign in to comment.