|
1 | 1 | /* |
2 | | - * Copyright 2012-2019 the original author or authors. |
| 2 | + * Copyright 2012-2021 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -49,9 +49,10 @@ public class StopMojo extends AbstractMojo { |
49 | 49 | private MavenProject project; |
50 | 50 |
|
51 | 51 | /** |
52 | | - * Flag to indicate if process to stop was forked. By default, the value is inherited |
53 | | - * from the {@link MavenProject}. If it is set, it must match the value used to |
54 | | - * {@link StartMojo start} the process. |
| 52 | + * Flag to indicate if the process to stop was forked. By default, the value is |
| 53 | + * inherited from the {@link MavenProject} with a fallback on the default fork value |
| 54 | + * ({@code true}). If it is set, it must match the value used to {@link StartMojo |
| 55 | + * start} the process. |
55 | 56 | * @since 1.3.0 |
56 | 57 | */ |
57 | 58 | @Parameter(property = "spring-boot.stop.fork") |
@@ -103,8 +104,11 @@ private boolean isForked() { |
103 | 104 | if (this.fork != null) { |
104 | 105 | return this.fork; |
105 | 106 | } |
106 | | - String property = this.project.getProperties().getProperty("_spring.boot.fork.enabled"); |
107 | | - return Boolean.parseBoolean(property); |
| 107 | + String forkFromStart = this.project.getProperties().getProperty("_spring.boot.fork.enabled"); |
| 108 | + if (forkFromStart != null) { |
| 109 | + return Boolean.parseBoolean(forkFromStart); |
| 110 | + } |
| 111 | + return true; |
108 | 112 | } |
109 | 113 |
|
110 | 114 | private void stopForkedProcess() throws IOException, MojoFailureException, MojoExecutionException { |
|
0 commit comments