Debug Spring MVC with IntelliJ IDEA Community Edition & Tomcat (Windows)

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.

Install Smart Tomcat plugin

Now you need to Edit Configurations. Select Edit Configurations from Run -> Edit Configurations.

Select 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.

Run/Configurations window

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.

Tomcat configurations

Horray! 😁 You’re almost done. Add breakpoints and start debugging.

Click the debug button

Living a simple life right now