grails 3 debug button disabled - workaround suggested by docs doesn't achieve same functionality

Answered

The debug button is disabled for Grails 3, providing no easy way to issue a "grails run-app" command in debug mode.  The UI provides no explanation.  

 

The information for "Debugging Grails 3 Application" at https://www.jetbrains.com/help/idea/2016.1/getting-started-with-grails-3.html does not actually provide the same functionality.  

 

After much investigation, I found a way to achieve the lost functionality.  It requires creating 2 different entries in the Run/Debug Configurations pulldown menu:

 

 (entry 1) invoke Grails run-app with a --debug-jvm flag

(entry 2) attach a debugger to it  

I suspect this is exactly what happens behind the scenes when the debug button is clicked for a Grails 2.x app.

 

4 comments

Nope, it's not what happens with Grails 2. Grails 2 has the possibility to pass vm arguments to forked instance and Grails 3 doesn't.
You still have two choices for debugging. What do you mean by "same functionality"?

0

The docs explain how to launch it as a regular java app via the main() method which doesn't provide the Grails goodness of "grails run-app" which provides "hot-swap" class reloading, etc.  In addition to that approach, I am able to

1) grails run-app --debug-jvm

2) then use IntelliJ to attach a debugger to the "remote" instance I just launched.  

It is by combining these 2 steps that I am able to recreate for my Grails 3 app the same functionality that IntelliJ provides  out of the box for Grails 2.x apps when the developer clicks the debug button for the "run-app" command.

0

Try to add "-noverify" to jvm args in Application.main() run configuration

0

tried it.  that doesn't cast the "run-app" magic

 

Here's somebody else who came up with another workaround in addition mine above.

http://stackoverflow.com/questions/36557806/grails-3-debugging-in-intellij

 

What I'm saying is: it would be nice if IntelliJ had this feature out-of-the-box.

 

 

0

Please sign in to leave a comment.