IntelliJ 可以在调试模式下运行 Maven 项目,但会忽略断点
我有一个 Java 8/Spring Boot/Maven 应用程序,可以在我的 IntelliJ IDE 中运行。当我单击绿色箭头(下方右上角)时,会显示控制台,一切都会正常启动,我可以在浏览器中使用该应用程序,通过curl 命中端点等。
我现在正在尝试让调试器正常工作。当我停止应用程序,然后通过单击调试器(上面的屏幕截图中播放图标旁边的绿色错误图标)重新启动它时,应用程序再次启动,没有任何问题。问题是,我设置的断点(在运行之前)没有执行!这意味着当应用程序遇到一行设置了断点的代码时,该过程不会暂停,并且我没有看到 IntelliJ 挂在该代码行(等待我采取行动),就像我在其他项目中习惯的那样。
例如,上面的 SpringApplication.run(...)
方法上设置了一个断点。但是当我在调试模式下启动它时,它只是启动并且永远不会在那一行停止!
以下是我对该项目的编辑配置设置:
有什么问题吗?我是否需要设置一些不同/特殊的东西才能进行调试?提前致谢。
I have a Java 8/Spring Boot/Maven application that I can run in my IntelliJ IDE just fine. When I click the green arrow (top right corner below) a console displays and everything starts up without issue, and I can use the app in the browser, hit endpoints via curl, etc.
I am now trying to get the debugger working. When I stop the application and then restart it by clicking the debugger (green bug icon next to the play icon in the screenshot above), again the app starts up without any issue whatsoever. The problem is, the breakpoints I'm setting (prior to running) are not executing! Meaning when the app encounters a line of code with the breakpoint set, the process is not paused and I don't see IntelliJ hanging at the line of code (waiting for me to take action) like I'm used to in other projects.
For instance, above, the SpringApplication.run(...)
method has a breakpoint set on it. But when I start it up in debug mode, it just starts up and never stops at that line!
Here are my Edit Configurations settings for this project:
Does anything look off? Do I need to set up something different/special for the debugging to work? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
false
添加到spring-boot-maven-plugin
配置中:相关请求:IDEA-175246。
Add
<fork>false</fork>
intospring-boot-maven-plugin
configuration:Related request: IDEA-175246.