Merge branch '2.6.x' into 2.7.x
Closes gh-31177
This commit is contained in:
@@ -192,7 +192,7 @@ public class StartMojo extends AbstractRunMojo {
|
||||
}
|
||||
}
|
||||
|
||||
private void waitForForkedSpringApplication() throws IOException, MojoFailureException, MojoExecutionException {
|
||||
private void waitForForkedSpringApplication() throws IOException, MojoExecutionException {
|
||||
try {
|
||||
getLog().debug("Connecting to local MBeanServer at port " + this.jmxPort);
|
||||
try (JMXConnector connector = execute(this.wait, this.maxAttempts, new CreateJmxConnector(this.jmxPort))) {
|
||||
@@ -214,7 +214,7 @@ public class StartMojo extends AbstractRunMojo {
|
||||
}
|
||||
|
||||
private void doWaitForSpringApplication(MBeanServerConnection connection)
|
||||
throws IOException, MojoExecutionException, MojoFailureException {
|
||||
throws MojoExecutionException, MojoFailureException {
|
||||
final SpringApplicationAdminClient client = new SpringApplicationAdminClient(connection, this.jmxName);
|
||||
try {
|
||||
execute(this.wait, this.maxAttempts, () -> (client.isReady() ? true : null));
|
||||
|
||||
@@ -115,14 +115,14 @@ public class StopMojo extends AbstractMojo {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void stopForkedProcess() throws IOException, MojoFailureException, MojoExecutionException {
|
||||
private void stopForkedProcess() throws IOException, MojoExecutionException {
|
||||
try (JMXConnector connector = SpringApplicationAdminClient.connect(this.jmxPort)) {
|
||||
MBeanServerConnection connection = connector.getMBeanServerConnection();
|
||||
doStop(connection);
|
||||
}
|
||||
}
|
||||
|
||||
private void stop() throws IOException, MojoFailureException, MojoExecutionException {
|
||||
private void stop() throws IOException, MojoExecutionException {
|
||||
doStop(ManagementFactory.getPlatformMBeanServer());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user