From 10ffaffb7b6716883a44cb36e021fc6003ef8b52 Mon Sep 17 00:00:00 2001 From: Marcus Klimstra Date: Mon, 10 May 2021 17:03:39 +0200 Subject: [PATCH 1/2] Improve configuration of Start and Stop goals See gh-26422 --- .../springframework/boot/maven/StartMojo.java | 16 ++++++++-------- .../org/springframework/boot/maven/StopMojo.java | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java index 0ae146fd42..1cd07a6fd8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java @@ -61,29 +61,29 @@ public class StartMojo extends AbstractRunMojo { * The JMX name of the automatically deployed MBean managing the lifecycle of the * spring application. */ - @Parameter - private String jmxName = SpringApplicationAdminClient.DEFAULT_OBJECT_NAME; + @Parameter(defaultValue = SpringApplicationAdminClient.DEFAULT_OBJECT_NAME) + private String jmxName; /** * The port to use to expose the platform MBeanServer if the application is forked. */ - @Parameter - private int jmxPort = 9001; + @Parameter(defaultValue = "9001") + private int jmxPort; /** * The number of milli-seconds to wait between each attempt to check if the spring * application is ready. */ - @Parameter - private long wait = 500; + @Parameter(property = "spring-boot.start.wait", defaultValue = "500") + private long wait; /** * The maximum number of attempts to check if the spring application is ready. * Combined with the "wait" argument, this gives a global timeout value (30 sec by * default) */ - @Parameter - private int maxAttempts = 60; + @Parameter(property = "spring-boot.start.maxAttempts", defaultValue = "60") + private int maxAttempts; private final Object lock = new Object(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StopMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StopMojo.java index 5afb6b8f30..86bef74bf4 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StopMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StopMojo.java @@ -62,15 +62,15 @@ public class StopMojo extends AbstractMojo { * The JMX name of the automatically deployed MBean managing the lifecycle of the * application. */ - @Parameter - private String jmxName = SpringApplicationAdminClient.DEFAULT_OBJECT_NAME; + @Parameter(defaultValue = SpringApplicationAdminClient.DEFAULT_OBJECT_NAME) + private String jmxName; /** * The port to use to lookup the platform MBeanServer if the application has been * forked. */ - @Parameter - private int jmxPort = 9001; + @Parameter(defaultValue = "9001") + private int jmxPort; /** * Skip the execution. From b7f126020e6888841e927f1f929cd0963dee3c79 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 31 May 2021 08:59:34 +0200 Subject: [PATCH 2/2] Update copyright year of change file See gh-26422 --- .../src/main/java/org/springframework/boot/maven/StartMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java index 1cd07a6fd8..8fe7c84e34 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/StartMojo.java @@ -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.