Terminating mvn spring-boot:run doesn't stop tomcat

后端 未结 18 1376
别那么骄傲
别那么骄傲 2020-12-04 07:11

I can successfully start spring-boot with mvn spring-boot, the documentation mentions to gracefully exit the application hit ctrl-c.



        
18条回答
  •  天命终不由人
    2020-12-04 07:57

    This solution worked for me with Spring Boot v1.x und works now, with v2.x:

    hangingJavaProcessToStop=`jps | grep Application | awk '{print $1}'`
    echo "hangingJavaProcessToStop: $hangingJavaProcessToStop"
    kill -9 $hangingJavaProcessToStop
    

    This way you can kill specifically Spring Boot's Application Java process instead of killing all Java processes at once. I assume if your Spring Boot "Application" (main method containing class) is called differently, you must use its name instead of Application.

    I am running the snippet above, on my Windows machine using WSL/Debian. I am not using PowerShell or Windows'command line.

提交回复
热议问题