Skip to content

Commit 2c53988

Browse files
committed
Polish "Deprecate running an application in the Maven JVM"
See gh-30479
1 parent 09696c9 commit 2c53988

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/RunIntegrationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -45,12 +45,14 @@ void whenTheRunGoalIsExecutedTheApplicationIsForkedWithOptimizedJvmArguments(Mav
4545
}
4646

4747
@TestTemplate
48+
@Deprecated
4849
void whenForkingIsDisabledAndDevToolsIsPresentDevToolsIsDisabled(MavenBuild mavenBuild) {
4950
mavenBuild.project("run-devtools").goals("spring-boot:run").execute((project) -> assertThat(buildLog(project))
5051
.contains("I haz been run").contains("Fork mode disabled, devtools will be disabled"));
5152
}
5253

5354
@TestTemplate
55+
@Deprecated
5456
void whenForkingIsDisabledJvmArgumentsAndWorkingDirectoryAreIgnored(MavenBuild mavenBuild) {
5557
mavenBuild.project("run-disable-fork").goals("spring-boot:run")
5658
.execute((project) -> assertThat(buildLog(project)).contains("I haz been run").contains(
@@ -103,6 +105,7 @@ void whenProfilesAreConfiguredTheyArePassedToTheApplication(MavenBuild mavenBuil
103105
}
104106

105107
@TestTemplate
108+
@Deprecated
106109
void whenProfilesAreConfiguredAndForkingIsDisabledTheyArePassedToTheApplication(MavenBuild mavenBuild) {
107110
mavenBuild.project("run-profiles-fork-disabled").goals("spring-boot:run").execute(
108111
(project) -> assertThat(buildLog(project)).contains("I haz been run with profile(s) 'foo,bar'"));

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/intTest/java/org/springframework/boot/maven/StartStopIntegrationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@
3333
class StartStopIntegrationTests {
3434

3535
@TestTemplate
36+
@Deprecated
3637
void startStopWithForkDisabledWaitsForApplicationToBeReadyAndThenRequestsShutdown(MavenBuild mavenBuild) {
3738
mavenBuild.project("start-stop-fork-disabled").goals("verify").execute(
3839
(project) -> assertThat(buildLog(project)).contains("isReady: true").contains("Shutdown requested"));

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractRunMojo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -265,6 +265,7 @@ private void run(String startClassName) throws MojoExecutionException, MojoFailu
265265
* Log a warning indicating that fork mode has been explicitly disabled while some
266266
* conditions are present that require to enable it.
267267
*/
268+
@Deprecated
268269
protected void logDisabledFork() {
269270
if (getLog().isWarnEnabled()) {
270271
if (hasAgent()) {

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RunMojo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -63,6 +63,7 @@ public class RunMojo extends AbstractRunMojo {
6363
private boolean optimizedLaunch;
6464

6565
@Override
66+
@Deprecated
6667
protected void logDisabledFork() {
6768
super.logDisabledFork();
6869
if (hasDevtools()) {

spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StopMojo.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2021 the original author or authors.
2+
* Copyright 2012-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,8 +54,10 @@ public class StopMojo extends AbstractMojo {
5454
* ({@code true}). If it is set, it must match the value used to {@link StartMojo
5555
* start} the process.
5656
* @since 1.3.0
57+
* @deprecated since 2.7.0 for removal in 3.0.0 with no replacement
5758
*/
5859
@Parameter(property = "spring-boot.stop.fork")
60+
@Deprecated
5961
private Boolean fork;
6062

6163
/**
@@ -80,6 +82,7 @@ public class StopMojo extends AbstractMojo {
8082
private boolean skip;
8183

8284
@Override
85+
@SuppressWarnings("deprecation")
8386
public void execute() throws MojoExecutionException, MojoFailureException {
8487
if (this.skip) {
8588
getLog().debug("skipping stop as per configuration.");
@@ -100,6 +103,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
100103
}
101104
}
102105

106+
@Deprecated
103107
private boolean isForked() {
104108
if (this.fork != null) {
105109
return this.fork;

0 commit comments

Comments
 (0)