mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Update RunMojo to fail when forked JVM returned non-zero exit code
Closes gh-6172
This commit is contained in:
parent
159ef8f189
commit
ec7d6381aa
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user