Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to debug spring application with gradle

I am working on spring app and need to step through a controller method to see how it works. I am working in eclipse and building my app with gradle bootRun command.

How to run it in debug mode?

i tried gradle bootRun --debug but it's just debug log, not debug mode

i tried gradle help --task bootRun -- this gives me info about task there i saw --debug-jvm option but when i run gradle bootRun --debug-jvm application doesn't start

like image 969
rigby Avatar asked Sep 14 '16 12:09

rigby


People also ask

How do I debug a gradle Spring project?

Configure with Project -> Debug as… -> Debug Configuration -> Remote Java Application. As host set localhost, and port 5005. After click DEBUG button, debugging mode will attach to 5005, and Gradle will continue to launch application.

How do I debug spring boot gradle in Eclipse?

In Eclipse, from the toolbar, select Run -> Debug Configurations -> select Remote Java Application -> click the New button -> select as Connection Type Standard (Socket Attach), as Host localhost, and as Port 8002 (or whatever you have configured in the steps before). Click Apply and then Debug.


1 Answers

After you run gradle bootRun --debug-jvm the application is suspended until you connect your debugger to the port it is listening on (port 5005).

like image 151
dankirkd Avatar answered Sep 20 '22 08:09

dankirkd