问题
I am trying to debug maven with: jdb -attach 8000, after using mvnDebug.
I try to put breakpoints, but get:
main[1] stop in DeployMojo.DeployMojo
Deferring breakpoint DeployMojo.DeployMojo.
It will be set after the class is loaded.
main[1] stop at Dependency:66
Deferring breakpoint Dependency:66.
It will be set after the class is loaded.
When I run, the breakpoints are not called. I have the sources (generated with a maven command), but how can I make them available to the debugger?
Is there a class loader where I could put a breakpoint?
回答1:
This may happen because your class names are wrong or because you omitted the package.
If class Dependency is in package com.my.package, then break in class com.my.package.Dependency and not in Dependency.
回答2:
I was using jdb -attach -sourcepath ~/path/to/project/main/java. Turns out jdb doesn't like the ~ and needs jdb -attach -sourcepath $HOME/path/to/project/main/java or the absolute path.
来源:https://stackoverflow.com/questions/10911704/deferred-breakpoints-when-are-classes-loaded