You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让IntelliJ调试器跳过Spring类,仅调试自定义代码?

解决IntelliJ调试Spring Boot时跳过框架类的方法

方法一:配置「不进入类」列表

  • 打开IntelliJ设置(快捷键Ctrl+Alt+S / Cmd+,)
  • 进入 Build, Execution, Deployment > Debugger > Stepping 页面
  • 在 Do not step into the classes 区域,添加需要跳过的框架包路径:
    • org.springframework.**(覆盖所有Spring框架类)
    • 可选添加java.**、com.sun.**跳过JDK及系统内置类
  • 勾选 Use "do not step into" list,保存设置即可

方法二:使用「强制单步跳过」快捷键

  • 在自己的代码行执行调试时,按下Shift+F8(Windows/Linux/Mac),这个操作会直接跳过所有框架类代码,只停留在自定义代码的下一行

方法三:断点包过滤

  • 右键点击代码行左侧的断点红点,选择 Edit breakpoint
  • 在断点设置窗口中,找到 Filters 选项
  • 添加允许触发断点的包路径(如你的项目包com.yourteam.**),这样断点只会在你自己的代码中生效

示例代码

@GetMapping("/restapi")
public String restapi() {
    String result = "hello"; // breakpoint
    return result; // after this statement 
         //debugger goes into InvocableHandlerMethod
}

内容的提问来源于stack exchange,提问作者m_jdm35

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.25 19:02:20