My Spring Boot
webapp is running just fine, and I\'d like to debug it through Eclipse.
So when launching my Remote Java Application debugger, which port
I didn't need to set up remote debugging in order to get this working, I used Maven.
spring-boot::run
.NB. If your IDE has problems finding your project's source code when doing line-by-line debugging, take a look at this SO answer to find out how to manually attach your source code to the debug application.
Hope this helps someone!
This question is already answered, but i also got same issue to debug Springboot + gradle + jHipster,
Mostly Spring boot application can debug by right click and debug, but when you use gradle, having some additional environment parameter setup then it is not possible to debug directly.
To resolve this, Eclipse provided one additional features as Remote Java Application
by using this features you can debug your application.
Follow below step:
run your gradle application with
./gradlew bootRun --debug-jvm
command
Now go to eclipse --> right click project and Debug configuration --> Remote Java Application.
add you host and port as localhost and port as 5005 (default for gradle debug, you can change it)
Refer for more detail and step.
Right click on the spring boot project -> debug as -> spring boot App
. Put a debugger point and invoke the app from a client like postman
Run below command where pom.xml
is placed:
mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
And start your remote java application with debugging option on port 5005
Why don't you just right click on the main()
method and choose "Debug As... Java Application"
?
Easier solution:
Instead of typing mvn spring-boot:run
,
simply type mvnDebug spring-boot:run
You will still need to attach the debugger in Eclipse by making a new Debug Configuration for a "Remote Java Application" on the relevant port.