Intellij IDEA – Auto reload a web application (hot deploy)

In this tutorial, we will show you how to ‘hot deploy’ or ‘hot swap’ a web application in IDEA.

Note
Tested with Intellij IDEA 14 and 15

1. Select exploded WAR

Go Run –>> Edit Configurations –>> “Deployment” tab, clicks + icon –>> select an “exploded artifact”

idea-hot-deploy-exploded

2. Update classes and resources

Select “Server” tab, update the following options :

  1. On ‘Update’ action -> Update classes and resources
  2. On frame deactivation -> Update classes and resources
idea-hot-deploy-1

3. Run in Debug Mode

Run web application in Debug mode. Try to modify some codes or resources (JSP or html), the modified classes and resources will be reloaded automatically.

Done.

References

  1. How to configure hot deploy in Eclipse

About the Author

author image
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

avatar
6 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
8 Comment authors
SergeyRenanfarzanPhilAndrey Recent comment authors
newest oldest most voted
Ömer Hakan Bilici
Guest
Ömer Hakan Bilici

Is that settings has limitations like Eclipse hot swap you referenced? Or jdk version?

hello
Guest
hello

will it work in multi-module maven project?

Phil
Guest
Phil

Awesome! After making these changes, I made a code change in Intellij, alt-tabbed to browser, watched Intellij in Taskbar finishing animating, and code change took effect.

farzan
Guest
farzan

Thanks so much. It works.

Renan
Guest
Renan

Hi!
Thanks a lot for this.
It has working very well until today, when I updated my IntelliJ to version 2018.03
Now I’m getting this message:
‘MyProject’ is not allowed to run in parallel.
Would you like to stop the running one?

Do you know what I need to configure? Its something on IntelliJ or on my Tomcat?

Sergey
Guest
Sergey

exploded war for debug is a need to know information. thanks