1

Currently I'm developing a Web App with Spring MVC and Spring Security using Maven to build the application and Tomcat as a webserver.

When I'm making changes in my JSP files, I can immediately see the changes (when the application is running) when I do a reload in my webbrowser.

However, when I make changes in my Java files (for instance in a Controller class), I have to redeploy the application (which takes 10 to 15 seconds) to get the changes working.

So my question is: Is there a way how to NOT do a redeploy every time when I perform changes in my Java classes?

Thank you very much!

zappee
  • 20,148
  • 14
  • 73
  • 129
toniweser
  • 55
  • 8

3 Answers3

3

We call what you would like to achive is Hot Deploy.

There are many different way to apply Hot Deploy, so the best way is to google for it.

zappee
  • 20,148
  • 14
  • 73
  • 129
2

Thanks for your responses. I tried some more options and this is working fine for me:

  • Go to Run / Edit Configurations / “Deployment” tab, clicks + icon / select an “exploded artifact”
  • Select “Server” tab, update the following options :
    1. On ‘Update’ action -> Update classes and resources
    2. On frame deactivation -> Update classes and resources
  • Run web application in Debug mode. Try to modify some codes or resources (Java files, ...), the modified classes and resources will be reloaded automatically without any redeploy or something like that.
toniweser
  • 55
  • 8
1

You can do a hot deploy using this plugin JRebel but if your build is only 10-15 seconds I think that a hot deploy is overkilling

TheOni
  • 810
  • 9
  • 26
  • "but if your build is only 10-15 seconds I think that a hot deploy is overkill" - Agreed. And you have the additional problem of hot deploy not working, or filling the heap with uncollectable garbage, or causing unexpected things to happen that interfere with your debugging, etc – Stephen C Jun 06 '18 at 07:39