I have the following script
#!/bin/bash
cd ../../../configuration-service
mvn -e -X spring-boot:stop &>log.log &
Which is intended for stop the SpringBoot application , here is entire app (single java file)
@EnableConfigServer
@SpringBootApplication
public class ConfigurationServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigurationServiceApplication.class, args);
}
}
and script fails with the following error:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:stop (default-cli) on project configuration-service: Spring application lifecycle JMX bean not found (fork is null). Could not stop application gracefully: org.springframework.boot:type=Admin,name=SpringApplication -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:stop (default-cli) on project configuration-service: Spring application lifecycle JMX bean not found (fork is null). Could not stop application gracefully
Please tell me how to stop this Spring Boot application. I need to terminate this service from another Spring Boot application (from another microservice)
I have tried
mvn -e -X spring-boot:stop &>log.log &
expecting graceful stop of SpringBoot application