I have a (Maven-based) project A loaded in Intellij that has a number of dependencies.
I have the source files of one of those dependencies (say B) in another Intell
The other answers sound like they would work, but all I had to do was go to:
Project Structure (Alt+Shift+S)
> Modules
> on the Sources tab for the module that has dependencies, look on the right side,
click the + Add Content Root, then add the src
folder of the dependency project.
I was able to then put breakpoints in those src
files and IntelliJ would step to them in debugging.
(Note you may see the warning "Alternative source available for the class ...
")
Reference
From https://www.jetbrains.com/help/idea/creating-and-managing-modules.html,
"Modules normally have one content root. You can add more content roots. For example, this might be useful if pieces of your code are stored in different locations on your computer."