IDEA 2019 deployment requires build and update
Answered
While debugging a tomcat deployment any code changes I made would automatically cause a deployment update under IDEA 2018 whenever I clicked build project (green hammer). But under IDEA 2019 it seems I now need to explicitly click update on the server tab after waiting for the build project process to finish? Is there an option to return IDEA to the previous flow? automate the update on a build?
Please sign in to leave a comment.
See https://zeroturnaround.com/software/jrebel/quickstart/intellij/enable-automatic-compilation-in-intellij-idea/ .
So go buy jrebel?
This isn't what I asked. I wanted to work the same way I have been to on all versions up until IDEA 2019. When I compile while debugging it immediately updates the deployment. When I click compile, not when I save anything, not automated compilation. Wondering why this automated update was removed, is it a setting I've somehow changed by accident recently? or has the IDEA IDE itself been changed and the auto-update was deliberately removed?
It's not about JRebel, just the options you need to enable in IntelliJ IDEA. They are not specific to JRebel.
See also https://www.jetbrains.com/help/idea/updating-applications-on-application-servers.html .
With the app server you can configure Update action to trigger on frame deactivation. Just edit the code, switch to the browser with Alt+Tab, this will trigger the Update action and the corresponding actions in the IDE, like Update classes and resources. IDE will save the changes, compile the code, update the artifact resources. Then you can just Refresh the page in the browser to get the fresh results for your latest changes in the code.
Can I set it up to update classes and resources on build project though? that's what I'm asking and how IDEA used to work. I normally have it setup to update resources on frame deactivation (not classes) and then 'build project' would automatically trigger a hotswap. It's this trigger-hotswap-on-compile that's missing?
From the names of those properties they don't sound like they'd change the hotswap-on-compile behaviour? I don't want compile on save nor hotswap on save. I know when changes I make will & won't hotswap and I need to redeploy. I've not had these systemproperties set before and it used to all work fine, it's just since updating to 2019 things have changed. Project files and run configs should all be the same.
Please share a sample project to reproduce the issue.
I've tried with the hello world servlet project and after Build | Build Project I get the popup saying "1 class reloaded". When I refresh the browser I see the new output.
There is a related issue at https://youtrack.jetbrains.com/issue/IDEA-210338 . Do you get classes reloaded after hitting Build twice?
Ah yes that is whats occuring, not using gradle but is a maven multi module project and there is a maven build step configured that runs on deployments (force update the deployments deps). Hitting build twice does trigger the missing hotswap so I'll add my vote to that. Was pretty sure something had changed and was messing with my workflow. The tricky bit is not knowing when the build and maven call had finished on compile so I found myself hitting update often a bit too early so found myself missing changes and after re-testing think I was losing it because nothing appeared to change. Previously I could just leave it to IDEA to do its jobs and it'd ask to hotswap when everything was built, no guesswork required.
It's a nightmare project though, hundreds of modules well over 1gb in size not something shareable.
Thank you