Skip to content

Commit

Permalink
Merge branch '2.3.x' into 2.4.x
Browse files Browse the repository at this point in the history
Closes gh-25483
  • Loading branch information
snicoll committed Mar 3, 2021
2 parents e984f0c + 8e67ae7 commit e5d8b60
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -49,9 +49,10 @@ public class StopMojo extends AbstractMojo {
private MavenProject project;

/**
* Flag to indicate if process to stop was forked. By default, the value is inherited
* from the {@link MavenProject}. If it is set, it must match the value used to
* {@link StartMojo start} the process.
* Flag to indicate if the process to stop was forked. By default, the value is
* inherited from the {@link MavenProject} with a fallback on the default fork value
* ({@code true}). If it is set, it must match the value used to {@link StartMojo
* start} the process.
* @since 1.3.0
*/
@Parameter(property = "spring-boot.stop.fork")
Expand Down Expand Up @@ -103,8 +104,11 @@ private boolean isForked() {
if (this.fork != null) {
return this.fork;
}
String property = this.project.getProperties().getProperty("_spring.boot.fork.enabled");
return Boolean.parseBoolean(property);
String forkFromStart = this.project.getProperties().getProperty("_spring.boot.fork.enabled");
if (forkFromStart != null) {
return Boolean.parseBoolean(forkFromStart);
}
return true;
}

private void stopForkedProcess() throws IOException, MojoFailureException, MojoExecutionException {
Expand Down

0 comments on commit e5d8b60

Please sign in to comment.