I occasionally forget how to configure Tomcat and Eclipse so that my code changes hot-swapped into the JVM when running a web application in debug. Here’s how…
Open Window > Preferences > Ivy > Classpath Container. Make sure ‘Resolve dependencies in workspace’ is checked:
With your web application selected, select the Project menu and ensure ‘Build automatically’ is checked:
Open your Tomcat configuration (by double clicking on the server in the Servers tab), and under the Server Options menu, uncheck all values:
On the same Tomcat configuration page, under the Publishing menu, select ‘Automatically publish when resources change':
Select the Modules tab at the bottom of the configuration page. Select your web application in the list and click the Edit… button.
Finally, in the Edit Web Module pop-up, uncheck ‘Auto reloading enabled':
Now when you run your application/server in Debug mode, you will be able to edit method bodies in your Java classes (including dependent projects open in your workspace) and have the changes automatically available without needing to rebuild or restart your server.
Your thoughts? I'd love to hear them. Please get in contact.