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?
The setup for this is two fold.
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. ie 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
In the current latest version of IntelliJ IDEA (2018.1) there is an option "Show alternative source switcher":
After enabling this option IDEA detects discrepancy of *.java
and *.class
files and offers to choose source of sources (sorry about tautology). It can ease pain of debugging in projects that consist of many modules.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.