Search code examples
javaplayframeworkspring-bootclassloader

Difference between Hot redeploy in Play and automatic restart in Spring Boot


If I take a look at Hot redeploy in Play and Automatic restart in Spring Boot, it seems very similar. Is there any principal difference between implementation of these features in these projects?


Solution

  • They are essentially the same in terms of implementation in that they both create a new application classloader to load in the new changes and discard the previous one.

    Note that here are a couple of options for running a Play application to trigger reload:-

    The following will trigger a rebuild and reload of classloader when a new request is received by the application, namely when you hit refresh in your browser. James Ward's plugin just saves you have to hit refresh.

    activator run
    

    The following will monitor your source directories for changes and will automatically re-compile any modified source on the fly. Although the server has recompiled the source and setup a new classloader you still need to do a refresh in your browser to see the changes (or use an extension like James Ward's).

    activator ~run