Merge branch '2.4.x'

Closes gh-25484
pull/25493/head
Stephane Nicoll 4 years ago
commit e58353a32d

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -49,9 +49,10 @@ public class StopMojo extends AbstractMojo {
private MavenProject project; private MavenProject project;
/** /**
* Flag to indicate if process to stop was forked. By default, the value is inherited * Flag to indicate if the process to stop was forked. By default, the value is
* from the {@link MavenProject}. If it is set, it must match the value used to * inherited from the {@link MavenProject} with a fallback on the default fork value
* {@link StartMojo start} the process. * ({@code true}). If it is set, it must match the value used to {@link StartMojo
* start} the process.
* @since 1.3.0 * @since 1.3.0
*/ */
@Parameter(property = "spring-boot.stop.fork") @Parameter(property = "spring-boot.stop.fork")
@ -103,8 +104,11 @@ public class StopMojo extends AbstractMojo {
if (this.fork != null) { if (this.fork != null) {
return this.fork; return this.fork;
} }
String property = this.project.getProperties().getProperty("_spring.boot.fork.enabled"); String forkFromStart = this.project.getProperties().getProperty("_spring.boot.fork.enabled");
return Boolean.parseBoolean(property); if (forkFromStart != null) {
return Boolean.parseBoolean(forkFromStart);
}
return true;
} }
private void stopForkedProcess() throws IOException, MojoFailureException, MojoExecutionException { private void stopForkedProcess() throws IOException, MojoFailureException, MojoExecutionException {

Loading…
Cancel
Save