Class reloading with grails 3 and IDEA 15
Answered
I'm using IDEA 15.0.1 with Grails 3.0.9. I converted a couple of projects from Grails 2.5 to 3 and everything seems to be working fine except for hot swapping.
My Debugger -> HotSwap is reload always. This video https://www.youtube.com/watch?v=aro3_RZqgtU seems to imply it will happen AutoMagically, but when I load my app home page it says
- Reloading active: false
Any pointers, tutorials or instructions for what to check to get class reloading working with IDEA and grails 3?
Thanks,
Roland
Please sign in to leave a comment.
I guess you have already googled for common issues and checked https://grails.org/wiki/Auto%20Reloading .
If it still doesn't work, please share a sample project to reproduce the problem.
I have the same problem - and the link posted by Serge doesn't work.
Phil,
How do you run the the app?
From the run configurations - I have two choices:
Spring Boot - Application, or
Grails - run-app
If I use the spring boot I get full debugging with stop on breakpoint, but no class reloading.
If I use the Grails run-app I get full class reloading but no stop on breakpoint (and it runs MUCH slower!)
Phil,
We are working on class reloading in spring boot applications: https://youtrack.jetbrains.com/issue/IDEA-141638
What IDEA version do you use? Similar issues about debug problems with run-app marked as fixed. May be you could provide sample project example for investigation?
It's been so long since I wrote this post that I don't really remember all the steps in between, but rather than use the Spring Boot - Application or the Grails - run app I open the Gradle task menu and right-click the bootRun task and choose "Debug" on that task from the drop down.
I can stop on break points and when I make a change, the next time I run a request through the app I see a message on the console that a change was detected and the code is recompiling. Then when the next request runs the new code will has been loaded. Not ideal, but for me nothing more than a minor inconvenience to submit the same request twice in row to see changes.
HTH
Roland
Yaroslav - I'm running the latest Intellij Ultimate, build IU-172.4574.11. I'll see if I can duplicate in a simple project.
Hi Roland - using the Gradle bootRun works great - thank you.
My only problem now is that I don't see any console output in the debug console, just the gradle output, so I don't see any application output or stack trace which makes debugging a bit awkward. Is there a way of turning that on?
Thanks
Phil
Phil,
That threw me for a while too, but there is a tiny button at the top second column of icons on the console window that toggles between the text console output and the task list.
Roland
Roland, that's brilliant. You're a star - thank you very much.
I now have exactly what I need to be an effective developer :)
Cheers
Phil