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
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. Read all published posts by

Comments

avatar
3000
newest oldest most voted
Mark
Guest
Mark

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
Guest
Sergey

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

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?

farzan
Guest
farzan

Thanks so much. It works.

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.

hello
Guest
hello

will it work in multi-module maven project?

Andrey
Guest
Andrey

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

Ömer Hakan Bilici
Guest
Ömer Hakan Bilici

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

mercenario
Guest
mercenario

The same limitations :p