This is a very simple and quick approach to debug your Spring application using Smart Tomcat. Smart Tomcat is a Tomcat server plugin for Intellij.
First, you need to add this plugin to your Spring application. So head over to your project Settings -> Plugins. Search for Smart Tomcat and install it.
Now you need to Edit Configurations. Select Edit Configurations from Run -> Edit Configurations.
Once the Run/Debug Configurations window opens click on the + sign to add a new configuration. Select Smart Tomcat from the given list.
Now you need to fill up the configuration fields. You can give any name you prefer to your tomcat server. Mine is tomcat8 since I’m using tomcat v8. Add your local tomcat server path to the Tomcat Server field. If you haven’t downloaded it locally you can find it from here.
Your Deployment Directory must be your Spring project directory. You can leave the rest of the fields as default. However, here I have changed my Context Path.
Horray! 😁 You’re almost done. Add breakpoints and start debugging.