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

mkyong

Founder of Mkyong.com, passionate Java and open-source technologies. If you enjoy my tutorials, consider making a donation to these charities.

13 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Michael Kunzmann
4 years ago

Unfortunately, it doesn’t work for me. I make changes to my Java code and save it in IntelliJ. The code appears to rebuild, but I still have to redeploy the war file to WildFly for it to work.

Kawu
4 years ago

Doesn’t work for IntelliJ IDEA 2021.3.3 and JBoss WildFly server. Not only that the IDE doesn’t indicate a changed file by putting an asterisk (*) onto the file name tab, pressing Ctrl+S doesn’t do a single thing. It seems like every keypress automatically saves the file?

Asmaa
3 years ago

hey
I just tried this in IntelliJ IDEA 2021.2 and it is still working.
Thank you.

Asmaa
3 years ago
Reply to  Asmaa

and Tomcat 10.0.22

Mark
6 years ago

Is there any way to hot deploy a change to a dependent jar file? – if a war depends on a jar and you make a change to one of the contained Java files?

Sergey
6 years ago

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

Renan
7 years ago

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?

farzan
7 years ago

Thanks so much. It works.

Phil
8 years ago

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.

hello
9 years ago

will it work in multi-module maven project?

Andrey
9 years ago
Reply to  hello

It doesn’t help to me. Are you shure that this is related with multi-midule project?

Ömer Hakan Bilici
10 years ago

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

mercenario
10 years ago

The same limitations :p