Intellij IDEA Breakpoints在JAR中停止,而不是我的项目的源代码 [英] Intellij IDEA Breakpoints stop in JARs instead of source code of my project

查看:631
本文介绍了Intellij IDEA Breakpoints在JAR中停止,而不是我的项目的源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.java文件中设置了一个断点。我通过maven-jetty插件启动了jetty。我设置断点的java文件也打包到JAR中。
Intellij在断点处停止,但它显示了打包到JAR而不是java文件的文件。它表现得好像我在第三方库源代码的java文件中设置断点。
如何让Intellij忽略我的JAR或强制Intellij停在我的.java文件?

I set a breakpoint in my .java file. I started jetty via maven-jetty plugin. The java file where I set the breakpoint is also packaged into a JAR. Intellij stops at the breakpoint, but it shows me the file which is packaged into the JAR instead of the java file. It behaves as if I set a breakpoint in a java file of 3rd party libraries source code. How can I either make Intellij ignore my JAR or force Intellij to stop at my .java file?

推荐答案

设置为两次。


  1. 将源添加到模块的一个类路径中。 (项目结构 - >依赖项 - >添加 - >模块依赖项 - >选择源并将其拖到所有库依赖项之上)

  2. 指向远程配置以搜索该特定模块的类路径中的源。见下图

有一个选项可以搜索整个项目的来源,但是当我尝试使用它时,这并未设置优先于本地可用的来源,而不是已下载的源。上面的解决方案为我解决了这个问题,但是在处理大型多项目设置时相对不令人满意。即我必须选择一个特定模块的类路径作为远程配置中的真实来源。在我看来,如果本地源存在,并且整个项目是搜索选项,IntelliJ应该足够聪明,可以选择本地源而不是库?

There is an option to search "whole project" for sources, but this did not set precedence to locally available sources, over downloaded sources, when I attempted to use it. The above solution fixed this problem for me, but it is relatively unsatisfactory when working with a large multiple project setup. i.e I had to pick one particular module's classpath as the source of truth in Remote Configurations. In my opinion, if the local source is present, and "whole project" is the search option, IntelliJ should be smart enough to choose local source over libaries

这篇关于Intellij IDEA Breakpoints在JAR中停止,而不是我的项目的源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆