From 14af1bb2dc52bc4a4bfcff2d47f2a2b790035fe7 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 26 May 2022 16:54:31 +0100 Subject: [PATCH] Polish --- .../java/org/springframework/boot/maven/StopMojo.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 956680bdc5..7982b0ad8e 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 @@ -74,8 +74,7 @@ public class StopMojo extends AbstractMojo { return; } getLog().info("Stopping application..."); - try (JMXConnector connector = SpringApplicationAdminClient - .connect(this.jmxPort)) { + try (JMXConnector connector = SpringApplicationAdminClient.connect(this.jmxPort)) { MBeanServerConnection connection = connector.getMBeanServerConnection(); stop(connection); } @@ -85,14 +84,13 @@ public class StopMojo extends AbstractMojo { } } - private void stop(MBeanServerConnection connection) throws IOException, MojoExecutionException { + private void stop(MBeanServerConnection connection) throws IOException, MojoExecutionException { try { new SpringApplicationAdminClient(connection, this.jmxName).stop(); } catch (InstanceNotFoundException ex) { throw new MojoExecutionException( - "Spring application lifecycle JMX bean not found. Could not stop application gracefully", - ex); + "Spring application lifecycle JMX bean not found. Could not stop application gracefully", ex); } }