Main Tutorials

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 Author

author image
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

Subscribe
Notify of
13 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Michael Kunzmann
1 year 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
2 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
1 year ago

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

Asmaa
1 year ago
Reply to  Asmaa

and Tomcat 10.0.22

Mark
3 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
4 years ago

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

Renan
5 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
5 years ago

Thanks so much. It works.

Phil
6 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
7 years ago

will it work in multi-module maven project?

Andrey
7 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
8 years ago

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

mercenario
8 years ago

The same limitations :p