How do I debug a gradle/Spring-boot app in IntelliJ Idea ? https://github.com/Muhuru-Bay-Microgrid/muhuru-bay-dashboard


(Ronald Pomeroy) #1

I have a vaadin+spring-boot+gradle app in development and I’m struggling with setting up debugging in IntelliJ Idea.

The project is at https://github.com/Muhuru-Bay-Microgrid/muhuru-bay-dashboard

Any help or advice is greatly appreciated.

Ron


(Peter Niederwieser) #2

Can you elaborate on how the question is related to Gradle? Typically, Gradle isn’t involved in running a debugging session from IntelliJ. You could make Gradle generate the IntelliJ debug configuration, but to do so, you’ll first have to figure out how to do it manually.


(Herick Oliveira) #3

I managed to debug a Spring Boot application run with Gradle as a remote app in IntelliJ Idea. It’s not a very complicated setup, I just had to pass in additional JVM parameters when running the application with Gradle if I recall (and of course set up the remote debugging configuration in Idea). I know I’d also cry tears of joy if there was a more productive way of achieving that, but I think this is an issue between Jetbrains and Spring, not really a Gradle issue.


(Herick Oliveira) #4

For the OP and anyone looking for a way to debug a Spring Boot application run with Gradle, as seen at http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#howto-remote-debug-gradle-run

Add this to your build.gradle file:

applicationDefaultJvmArgs = [

“-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005” ]

In IntelliJ Idea, setup a new Debug configuration and in the options select “Remote”. The defaults should be fine, but pay attention to the port number and transport type (“socket”). Have fun!