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
co
Define an executes a Java application in a child process.
task executeApp() {
doFirst {
println "Executing java app from Gradle..."
javaexec {
main = "com.mymain"
jvmArgs = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=30000"]
}
}
}
Set your breakpoints in the java code. After execute the Gradle task.For example in Windows:
.\gradlew.bat executeApp
The task waits until you attach the debugger. For example in Netbeans go to Debug->Attach debugger , set 30000 on port Field.