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
Tested with Intellij IDEA 14 and 15
1. Select exploded WAR
Go Run –>> Edit Configurations –>> “Deployment” tab, clicks + icon –>> select an “exploded artifact”
2. Update classes and resources
Select “Server” tab, update the following options :
- On ‘Update’ action -> Update classes and resources
- On frame deactivation -> Update classes and resources
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.
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.
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?
hey
I just tried this in IntelliJ IDEA 2021.2 and it is still working.
Thank you.
and Tomcat 10.0.22
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?
exploded war for debug is a need to know information. thanks
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?
Thanks so much. It works.
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.
will it work in multi-module maven project?
It doesn’t help to me. Are you shure that this is related with multi-midule project?
Is that settings has limitations like Eclipse hot swap you referenced? Or jdk version?
The same limitations :p