Tony Wolski

Enable hot-deployment with Tomcat + Eclipse + Ivy

2014-11-18

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…

  1. Open Window > Preferences > Ivy > Classpath Container. Make sure ‘Resolve dependencies in workspace’ is checked:

    Ivy, Classpath Container, Resolve Dependencies

  2. With your web application selected, select the Project menu and ensure ‘Build automatically’ is checked:

    Project, Build Automatically

  3. Open your Tomcat configuration (by double clicking on the server in the Servers tab), and under the Server Options menu, uncheck all values:

    Server Options, Uncheck All

  4. On the same Tomcat configuration page, under the Publishing menu, select ‘Automatically publish when resources change':

  5. Select the Modules tab at the bottom of the configuration page. Select your web application in the list and click the Edit… button.

    Web Modules, Edit

  6. Finally, in the Edit Web Module pop-up, uncheck ‘Auto reloading enabled':

    Web Module, 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.