From 9f2ed201b29c84a92db32b7a74d55c996d48e389 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Mon, 16 Jan 2023 15:58:03 +0100 Subject: [PATCH] Improve error message when start goal can't contact running application Closes gh-24044 --- .../main/java/org/springframework/boot/maven/StartMojo.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 f31d1dc3f0..c4f2b3a52f 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-2022 the original author or authors. + * Copyright 2012-2023 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. @@ -185,7 +185,8 @@ public class StartMojo extends AbstractRunMojo { } } catch (IOException ex) { - throw new MojoFailureException("Could not contact Spring Boot application", ex); + throw new MojoFailureException("Could not contact Spring Boot application via JMX on port " + this.jmxPort + + ". Please make sure that no other process is using that port", ex); } catch (Exception ex) { throw new MojoExecutionException("Could not figure out if the application has started", ex);