IntelliJ does not terminate Spring Boot applications build with gradle
I am pretty sure it's an IntelliJ issue because:
When you run the bootRun
from IntelliJ's Gradle integration and then press stop, the application continues to run as you mentioned.
However, if you use the command line and run gradle bootRun
and then use Cntrl+C, the application stops just fine.
Note that my setup is Windows 7, IntelliJ 13.1.3, Gradle 1.12 and Spring Boot 1.1.0.M2.
If your need to is to be able to easily debug your application, all you need to do is run the Java (or Groovy) Class that has the main
method, since that it is the easiest way to run Spring Boot applications! Kudos to Spring Boot for that!!!
Of course you can continue to use Gradle for tasks like running all the tests or creating the packaged application.
It's may not perfect solution. But for a quick fix, it will help you.
Goto terminal and apply this command to terminate the process
sudo kill -9 `sudo lsof -t -i:8080`
Note: Replace your port number instead of 8080